Class JSONObjectMarshaller
- java.lang.Object
-
- com.epimorphics.webapi.marshalling.JSONObjectMarshaller
-
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyWriter<org.apache.jena.atlas.json.JsonValue>
@Provider @Produces("application/json") public class JSONObjectMarshaller extends Object implements javax.ws.rs.ext.MessageBodyWriter<org.apache.jena.atlas.json.JsonValue>The default Jersey Marshaller doesn't seem to get registered so provide our own. Since we are doing that anyway then using the Atlas JSON implementation.- Author:
- Dave Reynolds
-
-
Constructor Summary
Constructors Constructor Description JSONObjectMarshaller()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetSize(org.apache.jena.atlas.json.JsonValue result, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)booleanisWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)voidwriteTo(org.apache.jena.atlas.json.JsonValue value, Class<?> doNotUse, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream)
-
-
-
Method Detail
-
getSize
public long getSize(org.apache.jena.atlas.json.JsonValue result, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)- Specified by:
getSizein interfacejavax.ws.rs.ext.MessageBodyWriter<org.apache.jena.atlas.json.JsonValue>
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
- Specified by:
isWriteablein interfacejavax.ws.rs.ext.MessageBodyWriter<org.apache.jena.atlas.json.JsonValue>
-
writeTo
public void writeTo(org.apache.jena.atlas.json.JsonValue value, Class<?> doNotUse, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream) throws IOException, javax.ws.rs.WebApplicationException- Specified by:
writeToin interfacejavax.ws.rs.ext.MessageBodyWriter<org.apache.jena.atlas.json.JsonValue>- Throws:
IOExceptionjavax.ws.rs.WebApplicationException
-
-