Class 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 Detail

      • JsonBodyWriter

        public JsonBodyWriter()
    • Method Detail

      • isWriteable

        public boolean isWriteable​(Class<?> type,
                                   Type genericType,
                                   Annotation[] annotations,
                                   javax.ws.rs.core.MediaType mediaType)
        Specified by:
        isWriteable in interface javax.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 interface javax.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 interface javax.ws.rs.ext.MessageBodyWriter<com.fasterxml.jackson.databind.node.ObjectNode>
        Throws:
        IOException