public class JSONRootElementProvider extends AbstractRootElementProvider
Modifier and Type | Class and Description |
---|---|
static class |
JSONRootElementProvider.App |
static class |
JSONRootElementProvider.General |
UTF8
Modifier and Type | Method and Description |
---|---|
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) |
protected Object |
readFrom(Class<Object> type,
javax.ws.rs.core.MediaType mediaType,
Unmarshaller u,
InputStream entityStream)
Unmarshal a JAXB type.
|
void |
setConfiguration(FeaturesAndProperties fp) |
protected void |
writeTo(Object t,
javax.ws.rs.core.MediaType mediaType,
Charset c,
Marshaller m,
OutputStream entityStream)
Marshal an instance of a JAXB type.
|
readFrom, writeTo
getMarshaller, getSAXSource, getStoredJAXBContext, getUnmarshaller, isFormattedOutput, isSupported, isXmlRootElementProcessing, setHeader
getCharset, getSize, readFromAsString, writeTo, writeTo, writeToAsString
@Context public void setConfiguration(FeaturesAndProperties fp)
setConfiguration
in class AbstractJAXBProvider<Object>
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
isReadable
in interface javax.ws.rs.ext.MessageBodyReader<Object>
isReadable
in class AbstractRootElementProvider
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
isWriteable
in interface javax.ws.rs.ext.MessageBodyWriter<Object>
isWriteable
in class AbstractRootElementProvider
protected final Object readFrom(Class<Object> type, javax.ws.rs.core.MediaType mediaType, Unmarshaller u, InputStream entityStream) throws JAXBException
AbstractRootElementProvider
Implementing classes may override this method.
readFrom
in class AbstractRootElementProvider
type
- the JAXB typemediaType
- the media typeu
- the unmarshaller to use for unmarshalling.entityStream
- the input stream to unmarshal from.JAXBException
protected void writeTo(Object t, javax.ws.rs.core.MediaType mediaType, Charset c, Marshaller m, OutputStream entityStream) throws JAXBException
AbstractRootElementProvider
Implementing classes may override this method.
writeTo
in class AbstractRootElementProvider
t
- the instance of the JAXB type.mediaType
- the meida type.c
- the character set to serialize characters to.m
- the marshaller to marshaller the instance of the JAXB type.entityStream
- the output stream to marshal to.JAXBException
Copyright © 2013 Oracle Corporation. All rights reserved.