Class SimpleTypeJsonProvider<T>

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

    @Produces("application/json")
    @Consumes("application/json")
    public class SimpleTypeJsonProvider<T>
    extends AbstractConfigurableProvider
    implements javax.ws.rs.ext.MessageBodyWriter<T>, javax.ws.rs.ext.MessageBodyReader<T>
    • Constructor Detail

      • SimpleTypeJsonProvider

        public SimpleTypeJsonProvider()
    • Method Detail

      • isWriteable

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

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

        public void writeTo​(T t,
                            Class<?> type,
                            Type genericType,
                            Annotation[] annotations,
                            javax.ws.rs.core.MediaType mediaType,
                            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
      • setSupportSimpleTypesOnly

        public void setSupportSimpleTypesOnly​(boolean supportSimpleTypesOnly)
      • isReadable

        public boolean isReadable​(Class<?> type,
                                  Type genericType,
                                  Annotation[] annotations,
                                  javax.ws.rs.core.MediaType mediaType)
        Specified by:
        isReadable in interface javax.ws.rs.ext.MessageBodyReader<T>
      • readFrom

        public T readFrom​(Class<T> type,
                          Type genericType,
                          Annotation[] annotations,
                          javax.ws.rs.core.MediaType mediaType,
                          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