com.ibm.commerce.foundation.rest.providers

Class JSONSDOProvider

  • java.lang.Object
    • com.ibm.commerce.foundation.rest.providers.AbstractSDOProvider
      • com.ibm.commerce.foundation.rest.providers.JSONSDOProvider
  • All Implemented Interfaces:
    javax.ws.rs.ext.MessageBodyReader<commonj.sdo.DataObject>, javax.ws.rs.ext.MessageBodyWriter<commonj.sdo.DataObject>


    @Provider
     @Consumes(value="application/sdo")
     @Produces(value="application/json")
    public class JSONSDOProvider
    extends com.ibm.commerce.foundation.rest.providers.AbstractSDOProvider
    implements javax.ws.rs.ext.MessageBodyReader<commonj.sdo.DataObject>, javax.ws.rs.ext.MessageBodyWriter<commonj.sdo.DataObject>
    This class converts a SDO into JSON.
    • Constructor Summary

      Constructors 
      Constructor and Description
      JSONSDOProvider() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void writeTo(commonj.sdo.DataObject dataObject, java.lang.Class<?> dataObjectClass, java.lang.reflect.Type dataObjectType, java.lang.annotation.Annotation[] resourceAnnotations, javax.ws.rs.core.MediaType responseMediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> responseHttpHeaders, java.io.OutputStream responseOutputStream)
      This method converts a SDO to JSON.
      • Methods inherited from class com.ibm.commerce.foundation.rest.providers.AbstractSDOProvider

        getSize, isReadable, isWriteable, readFrom
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.ws.rs.ext.MessageBodyReader

        isReadable, readFrom
      • Methods inherited from interface javax.ws.rs.ext.MessageBodyWriter

        getSize, isWriteable
    • Constructor Detail

      • JSONSDOProvider

        public JSONSDOProvider()
    • Method Detail

      • writeTo

        public void writeTo(commonj.sdo.DataObject dataObject,
                            java.lang.Class<?> dataObjectClass,
                            java.lang.reflect.Type dataObjectType,
                            java.lang.annotation.Annotation[] resourceAnnotations,
                            javax.ws.rs.core.MediaType responseMediaType,
                            javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> responseHttpHeaders,
                            java.io.OutputStream responseOutputStream)
                     throws java.io.IOException,
                            javax.ws.rs.WebApplicationException
        This method converts a SDO to JSON.
        Specified by:
        writeTo in interface javax.ws.rs.ext.MessageBodyWriter<commonj.sdo.DataObject>
        Parameters:
        dataObject - The SDO to convert.
        dataObjectClass - The SDO class.
        dataObjectType - The SDO type.
        resourceAnnotations - An array of annotations defined on the calling resource.
        responseMediaType - The media type to covert to, ie. "application/json".
        responseHttpHeaders - A map consisting of the response HTTP headers and the business context parameters of the request.
        responseOutputStream - The stream to write the response to.
        Throws:
        java.io.IOException
        javax.ws.rs.WebApplicationException