Interface MessageBodyWriter

  • All Known Implementing Classes:
    SingletonProvider

    @Deprecated
    public interface MessageBodyWriter
    Deprecated.
    Will be removed in next minor release.
    Interface to access a wrapped an initialized MessageBodyWriter
    See Also:
    MessageBodyWriter
    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      javax.ws.rs.ext.MessageBodyWriter<?> getJaxRsWriter()
      Deprecated.
      Returns the JAX-RS MessageBodyWriter.
      java.util.List<MediaType> getProducedMimes()
      Deprecated.
      Returns the list of produced MediaTypes of the wrapped MessageBodyWriter.
      long getSize​(java.lang.Object t, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, MediaType mediaType)
      Deprecated.
      Called before writeTo to ascertain the length in bytes of the serialized form of t.
      boolean isWriteable​(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
      Deprecated.
       
      boolean supportsWrite​(java.lang.Class<?> entityClass, java.lang.reflect.Type genericType)
      Deprecated.
      Checks, if this message body writer supports the given type (by the type parameter of the MessageBodyWriter)
      boolean supportsWrite​(java.lang.Iterable<MediaType> mediaTypes)
      Deprecated.
      Checks, if the wrapped MessageBodyWriter supports at least one of the given MediaTypes.
      boolean supportsWrite​(MediaType mediaType)
      Deprecated.
      Checks, if the wrapped MessageBodyWriter supports the given MediaType.
      void writeTo​(java.lang.Object object, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.Object> httpHeaders, java.io.OutputStream entityStream)
      Deprecated.
       
    • Method Detail

      • getJaxRsWriter

        javax.ws.rs.ext.MessageBodyWriter<?> getJaxRsWriter()
        Deprecated.
        Returns the JAX-RS MessageBodyWriter.
        Returns:
        the JAX-RS MessageBodyWriter
      • getProducedMimes

        java.util.List<MediaType> getProducedMimes()
        Deprecated.
        Returns the list of produced MediaTypes of the wrapped MessageBodyWriter.
        Returns:
        List of produced Restlet MediaTypes. If the entity provider is not annotated with @ Produces , '*/*' is returned.
      • getSize

        long getSize​(java.lang.Object t,
                     java.lang.Class<?> type,
                     java.lang.reflect.Type genericType,
                     java.lang.annotation.Annotation[] annotations,
                     MediaType mediaType)
        Deprecated.
        Called before writeTo to ascertain the length in bytes of the serialized form of t. A non-negative return value is used in a HTTP Content-Length header.
        Parameters:
        t - the instance to write
        type -
        genericType -
        annotations -
        mediaType - The Restlet MediaType
        Returns:
        length in bytes or -1 if the length cannot be determined in advance
        See Also:
        MessageBodyWriter.getSize(Object, Class, Type, Annotation[], javax.ws.rs.core.MediaType)
      • isWriteable

        boolean isWriteable​(java.lang.Class<?> type,
                            java.lang.reflect.Type genericType,
                            java.lang.annotation.Annotation[] annotations,
                            javax.ws.rs.core.MediaType mediaType)
        Deprecated.
        Parameters:
        type -
        genericType -
        annotations -
        mediaType - The JAX-RS MediaType
        Returns:
        true, if the wrapped writer could write an object of the given class with the given annotations and media type.
        See Also:
        javax.ws.rs.ext.MessageBodyWriter#isWriteable(Class, Type, Annotation[])
      • supportsWrite

        boolean supportsWrite​(java.lang.Class<?> entityClass,
                              java.lang.reflect.Type genericType)
        Deprecated.
        Checks, if this message body writer supports the given type (by the type parameter of the MessageBodyWriter)
        Parameters:
        entityClass - the type
        genericType - the generic type
        Returns:
        true, if this MessageBodyWriter supports the given type, false, if not.
      • supportsWrite

        boolean supportsWrite​(java.lang.Iterable<MediaType> mediaTypes)
        Deprecated.
        Checks, if the wrapped MessageBodyWriter supports at least one of the given MediaTypes.
        Parameters:
        mediaTypes - the Restlet MediaTypes
        Returns:
        true, if at least one of the requested MediaTypes is supported, otherwise false.
      • supportsWrite

        boolean supportsWrite​(MediaType mediaType)
        Deprecated.
        Checks, if the wrapped MessageBodyWriter supports the given MediaType.
        Parameters:
        mediaType - the Restlet MediaType
        Returns:
        true, if the requested MediaType is supported, otherwise false.
      • writeTo

        void writeTo​(java.lang.Object object,
                     java.lang.Class<?> type,
                     java.lang.reflect.Type genericType,
                     java.lang.annotation.Annotation[] annotations,
                     MediaType mediaType,
                     javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.Object> httpHeaders,
                     java.io.OutputStream entityStream)
              throws java.io.IOException,
                     javax.ws.rs.WebApplicationException
        Deprecated.
        Parameters:
        object -
        type -
        genericType -
        annotations -
        mediaType - The Restlet MediaType
        httpHeaders -
        entityStream -
        Throws:
        java.io.IOException
        javax.ws.rs.WebApplicationException
        See Also:
        MessageBodyWriter.writeTo(Object, Class, Type, Annotation[], javax.ws.rs.core.MediaType, MultivaluedMap, OutputStream)