Class JacksonJsonMarshaller<T>

    • Constructor Detail

      • JacksonJsonMarshaller

        public JacksonJsonMarshaller​(Class<T> clzRoot)
        Construct JacksonJsonMarshaller instance.
        Parameters:
        clzRoot - class of the root object this marshaller is for
    • Method Detail

      • marshal

        public void marshal​(T value,
                            OutputStream out,
                            javax.ws.rs.core.MultivaluedMap<String,​Object> httpHeaders)
                     throws IOException
        Description copied from interface: Marshaller
        Write the specified object into the given stream.
        Parameters:
        value - object to marshall
        out - the OutputStream for the HTTP entity. The implementation should not close the output stream.
        httpHeaders - a mutable map of the HTTP message headers.
        Throws:
        IOException - if an error occurs during marshalling
      • unmarshal

        public T unmarshal​(InputStream in,
                           javax.ws.rs.core.MediaType mediaType)
                    throws IOException
        Description copied from interface: Marshaller
        Read an object from the specified stream.
        Parameters:
        in - stream to read from
        mediaType - the media type of the object to read
        Returns:
        unmarshalled object instance
        Throws:
        IOException - if an error occurs during unmarshalling