Class BasicTypesMessageProvider
java.lang.Object
org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider<Object>
org.glassfish.jersey.message.internal.BasicTypesMessageProvider
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<Object>
,javax.ws.rs.ext.MessageBodyWriter<Object>
@Produces("text/plain")
@Consumes("text/plain")
@Singleton
final class BasicTypesMessageProvider
extends AbstractMessageReaderWriterProvider<Object>
The basic types message body provider for
MediaType.TEXT_PLAIN
media type.
The provider processes primitive types and also other Number
implementations like BigDecimal
,
BigInteger
, AtomicInteger
, AtomicLong
and all other implementations which has one String
argument constructor.-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider
UTF8
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
canProcess
(Class<?> type) long
getSize
(Object t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) boolean
isReadable
(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) boolean
isWriteable
(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) readFrom
(Class<Object> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String, String> httpHeaders, InputStream entityStream) void
writeTo
(Object o, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) Methods inherited from class org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider
getCharset, readFromAsString, writeTo, writeTo, writeToAsString
-
Constructor Details
-
BasicTypesMessageProvider
BasicTypesMessageProvider()
-
-
Method Details
-
isReadable
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) -
readFrom
public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, javax.ws.rs.WebApplicationException- Throws:
IOException
javax.ws.rs.WebApplicationException
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) -
canProcess
-
getSize
public long getSize(Object t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) - Specified by:
getSize
in interfacejavax.ws.rs.ext.MessageBodyWriter<Object>
- Overrides:
getSize
in classAbstractMessageReaderWriterProvider<Object>
-
writeTo
public void writeTo(Object o, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, javax.ws.rs.WebApplicationException- Throws:
IOException
javax.ws.rs.WebApplicationException
-