Class ObjectWriter

  • All Implemented Interfaces:
    javax.ws.rs.ext.MessageBodyWriter<Object>

    @Provider
    public class ObjectWriter
    extends Object
    implements javax.ws.rs.ext.MessageBodyWriter<Object>
    Provider responsible for marshalling Java objects.
    Author:
    as 2011.07.15
    • Constructor Detail

      • ObjectWriter

        public ObjectWriter()
        Default constructor.
      • ObjectWriter

        public ObjectWriter​(MarshallerRegistry registry)
        Construct an ObjectWriter instance.
        Parameters:
        registry - marshaller registry to use
    • Method Detail

      • isWriteable

        public boolean isWriteable​(Class<?> clz,
                                   Type type,
                                   Annotation[] aAnnotation,
                                   javax.ws.rs.core.MediaType mediaType)
        Specified by:
        isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<Object>
      • getSize

        public long getSize​(Object obj,
                            Class<?> clz,
                            Type type,
                            Annotation[] aAnnotation,
                            javax.ws.rs.core.MediaType mediaType)
        Specified by:
        getSize in interface javax.ws.rs.ext.MessageBodyWriter<Object>
      • writeTo

        public void writeTo​(Object obj,
                            Class<?> clz,
                            Type type,
                            Annotation[] aAnnotation,
                            javax.ws.rs.core.MediaType mediaType,
                            javax.ws.rs.core.MultivaluedMap<String,​Object> httpHeaders,
                            OutputStream stream)
                     throws IOException,
                            javax.ws.rs.WebApplicationException
        Specified by:
        writeTo in interface javax.ws.rs.ext.MessageBodyWriter<Object>
        Throws:
        IOException
        javax.ws.rs.WebApplicationException