@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>
Constructor and Description |
---|
JSONSDOProvider() |
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.
|
getSize, isReadable, isWriteable, readFrom
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
writeTo
in interface javax.ws.rs.ext.MessageBodyWriter<commonj.sdo.DataObject>
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.java.io.IOException
javax.ws.rs.WebApplicationException