Package org.onlab.rest
Class JsonBodyWriter
- java.lang.Object
-
- org.onlab.rest.JsonBodyWriter
-
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyWriter<com.fasterxml.jackson.databind.node.ObjectNode>
@Provider @Produces("application/json") public class JsonBodyWriter extends Object implements javax.ws.rs.ext.MessageBodyWriter<com.fasterxml.jackson.databind.node.ObjectNode>
JAX-RS Response message body writer.
-
-
Constructor Summary
Constructors Constructor Description JsonBodyWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getSize(com.fasterxml.jackson.databind.node.ObjectNode node, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
boolean
isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
void
writeTo(com.fasterxml.jackson.databind.node.ObjectNode node, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream)
-
-
-
Method Detail
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
- Specified by:
isWriteable
in interfacejavax.ws.rs.ext.MessageBodyWriter<com.fasterxml.jackson.databind.node.ObjectNode>
-
getSize
public long getSize(com.fasterxml.jackson.databind.node.ObjectNode node, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
- Specified by:
getSize
in interfacejavax.ws.rs.ext.MessageBodyWriter<com.fasterxml.jackson.databind.node.ObjectNode>
-
writeTo
public void writeTo(com.fasterxml.jackson.databind.node.ObjectNode node, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream) throws IOException
- Specified by:
writeTo
in interfacejavax.ws.rs.ext.MessageBodyWriter<com.fasterxml.jackson.databind.node.ObjectNode>
- Throws:
IOException
-
-