Class XmlRootObjectJaxbProvider
- java.lang.Object
-
- org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider<T>
-
- org.glassfish.jersey.jaxb.internal.AbstractJaxbProvider<Object>
-
- org.glassfish.jersey.jaxb.internal.XmlRootObjectJaxbProvider
-
- All Implemented Interfaces:
MessageBodyReader<Object>,MessageBodyWriter<Object>
- Direct Known Subclasses:
XmlRootObjectJaxbProvider.App,XmlRootObjectJaxbProvider.General,XmlRootObjectJaxbProvider.Text
public abstract class XmlRootObjectJaxbProvider extends AbstractJaxbProvider<Object>
Base XML-based message body reader for JAXB beans.- Author:
- Paul Sandoz, Marek Potociar
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXmlRootObjectJaxbProvider.AppProvider for un-marshalling entities ofapplication/xmlmedia type into JAXB beans usingJAXB unmarshaller.static classXmlRootObjectJaxbProvider.GeneralProvider for un-marshalling entities of<type>/<sub-type>+xmlmedia types into JAXB beans usingJAXB unmarshaller.static classXmlRootObjectJaxbProvider.TextProvider for un-marshalling entities oftext/xmlmedia type into JAXB beans usingJAXB unmarshaller.
-
Field Summary
-
Fields inherited from class org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider
UTF8
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected jakarta.xml.bind.JAXBContextgetStoredJaxbContext(Class type)Retrieve cached JAXB context capable of handling the given Java type.booleanisReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)booleanisWriteable(Class<?> arg0, Type arg1, Annotation[] arg2, MediaType mediaType)ObjectreadFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,String> httpHeaders, InputStream inputStream)voidwriteTo(Object arg0, Class<?> arg1, Type arg2, Annotation[] arg3, MediaType arg4, MultivaluedMap<String,Object> arg5, OutputStream arg6)-
Methods inherited from class org.glassfish.jersey.jaxb.internal.AbstractJaxbProvider
getMarshaller, getSAXSource, getUnmarshaller, isFormattedOutput, isSupported, isXmlRootElementProcessing, setConfiguration, setHeader
-
Methods inherited from class org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider
getCharset, getSize, readFromAsString, writeTo, writeTo, writeToAsString
-
-
-
-
Method Detail
-
getStoredJaxbContext
protected jakarta.xml.bind.JAXBContext getStoredJaxbContext(Class type) throws jakarta.xml.bind.JAXBException
Description copied from class:AbstractJaxbProviderRetrieve cached JAXB context capable of handling the given Java type.- Overrides:
getStoredJaxbContextin classAbstractJaxbProvider<Object>- Parameters:
type- Java type .- Returns:
- JAXB context associated with the Java type.
- Throws:
jakarta.xml.bind.JAXBException- in case the JAXB context retrieval fails.
-
isReadable
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
-
readFrom
public final Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,String> httpHeaders, InputStream inputStream) throws IOException
- Throws:
IOException
-
isWriteable
public boolean isWriteable(Class<?> arg0, Type arg1, Annotation[] arg2, MediaType mediaType)
-
writeTo
public void writeTo(Object arg0, Class<?> arg1, Type arg2, Annotation[] arg3, MediaType arg4, MultivaluedMap<String,Object> arg5, OutputStream arg6) throws IOException, WebApplicationException
- Throws:
IOExceptionWebApplicationException
-
-