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 java.lang.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, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
boolean
isWriteable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
void
writeTo(com.fasterxml.jackson.databind.node.ObjectNode node, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> httpHeaders, java.io.OutputStream entityStream)
-
-
-
Method Detail
-
isWriteable
public boolean isWriteable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.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, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.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, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> httpHeaders, java.io.OutputStream entityStream) throws java.io.IOException
- Specified by:
writeTo
in interfacejavax.ws.rs.ext.MessageBodyWriter<com.fasterxml.jackson.databind.node.ObjectNode>
- Throws:
java.io.IOException
-
-