Class 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JsonBodyWriter

        public JsonBodyWriter()
    • 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 interface javax.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 interface javax.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 interface javax.ws.rs.ext.MessageBodyWriter<com.fasterxml.jackson.databind.node.ObjectNode>
        Throws:
        java.io.IOException