Class DataFormatProvider<T>

  • All Implemented Interfaces:
    javax.ws.rs.ext.MessageBodyReader<T>, javax.ws.rs.ext.MessageBodyWriter<T>

    public class DataFormatProvider<T>
    extends Object
    implements javax.ws.rs.ext.MessageBodyWriter<T>, javax.ws.rs.ext.MessageBodyReader<T>
    • Constructor Detail

      • DataFormatProvider

        public DataFormatProvider()
    • Method Detail

      • isReadable

        public boolean isReadable​(Class<?> cls,
                                  Type type,
                                  Annotation[] anns,
                                  javax.ws.rs.core.MediaType mt)
        Specified by:
        isReadable in interface javax.ws.rs.ext.MessageBodyReader<T>
      • isWriteable

        public boolean isWriteable​(Class<?> cls,
                                   Type type,
                                   Annotation[] anns,
                                   javax.ws.rs.core.MediaType mt)
        Specified by:
        isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<T>
      • readFrom

        public T readFrom​(Class<T> cls,
                          Type type,
                          Annotation[] anns,
                          javax.ws.rs.core.MediaType mt,
                          javax.ws.rs.core.MultivaluedMap<String,​String> headers,
                          InputStream is)
                   throws IOException,
                          javax.ws.rs.WebApplicationException
        Specified by:
        readFrom in interface javax.ws.rs.ext.MessageBodyReader<T>
        Throws:
        IOException
        javax.ws.rs.WebApplicationException
      • getSize

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

        public void writeTo​(T obj,
                            Class<?> cls,
                            Type type,
                            Annotation[] anns,
                            javax.ws.rs.core.MediaType mt,
                            javax.ws.rs.core.MultivaluedMap<String,​Object> headers,
                            OutputStream os)
                     throws IOException,
                            javax.ws.rs.WebApplicationException
        Specified by:
        writeTo in interface javax.ws.rs.ext.MessageBodyWriter<T>
        Throws:
        IOException
        javax.ws.rs.WebApplicationException
      • setFormat

        public void setFormat​(org.apache.camel.spi.DataFormat format)
      • setFormat

        public void setFormat​(String mediaType,
                              org.apache.camel.spi.DataFormat format)
      • setFormats

        public void setFormats​(Map<String,​org.apache.camel.spi.DataFormat> formats)