Class XmlCollectionJaxbProvider
- java.lang.Object
-
- org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider<T>
-
- org.glassfish.jersey.jaxb.internal.AbstractJaxbProvider<java.lang.Object>
-
- org.glassfish.jersey.jaxb.internal.AbstractCollectionJaxbProvider
-
- org.glassfish.jersey.jaxb.internal.XmlCollectionJaxbProvider
-
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<java.lang.Object>,javax.ws.rs.ext.MessageBodyWriter<java.lang.Object>
- Direct Known Subclasses:
XmlCollectionJaxbProvider.App,XmlCollectionJaxbProvider.General,XmlCollectionJaxbProvider.Text
public abstract class XmlCollectionJaxbProvider extends AbstractCollectionJaxbProvider
Base XML-based message body provider for collections of JAXB beans.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXmlCollectionJaxbProvider.AppJAXB provider for marshalling/un-marshalling collections from/to entities ofapplication/xmlmedia type.static classXmlCollectionJaxbProvider.GeneralJAXB provider for marshalling/un-marshalling collections from/to entities of<type>/<sub-type>+xmlmedia types.static classXmlCollectionJaxbProvider.TextJAXB provider for marshalling/un-marshalling collections from/to entities oftext/xmlmedia type.-
Nested classes/interfaces inherited from class org.glassfish.jersey.jaxb.internal.AbstractCollectionJaxbProvider
AbstractCollectionJaxbProvider.JaxbTypeChecker
-
-
Field Summary
Fields Modifier and Type Field Description private javax.inject.Provider<javax.xml.stream.XMLInputFactory>xif-
Fields inherited from class org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider
UTF8
-
-
Constructor Summary
Constructors Constructor Description XmlCollectionJaxbProvider(javax.inject.Provider<javax.xml.stream.XMLInputFactory> xif, javax.ws.rs.ext.Providers ps)XmlCollectionJaxbProvider(javax.inject.Provider<javax.xml.stream.XMLInputFactory> xif, javax.ws.rs.ext.Providers ps, javax.ws.rs.core.MediaType mt)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.xml.stream.XMLStreamReadergetXMLStreamReader(java.lang.Class<?> elementType, javax.ws.rs.core.MediaType mediaType, javax.xml.bind.Unmarshaller u, java.io.InputStream entityStream)Get theXMLStreamReaderfor unmarshalling.voidwriteCollection(java.lang.Class<?> elementType, java.util.Collection<?> t, javax.ws.rs.core.MediaType mediaType, java.nio.charset.Charset c, javax.xml.bind.Marshaller m, java.io.OutputStream entityStream)Write a collection of JAXB objects as child elements of the root element.-
Methods inherited from class org.glassfish.jersey.jaxb.internal.AbstractCollectionJaxbProvider
getElementClass, getElementName, getRootElementName, isReadable, isWriteable, readFrom, verifyArrayType, verifyCollectionSubclass, verifyGenericType, writeTo
-
Methods inherited from class org.glassfish.jersey.jaxb.internal.AbstractJaxbProvider
getMarshaller, getSAXSource, getStoredJaxbContext, getUnmarshaller, isFormattedOutput, isSupported, isXmlRootElementProcessing, setConfiguration, setHeader
-
Methods inherited from class org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider
getCharset, getSize, readFromAsString, writeTo, writeTo, writeToAsString
-
-
-
-
Constructor Detail
-
XmlCollectionJaxbProvider
XmlCollectionJaxbProvider(javax.inject.Provider<javax.xml.stream.XMLInputFactory> xif, javax.ws.rs.ext.Providers ps)
-
XmlCollectionJaxbProvider
XmlCollectionJaxbProvider(javax.inject.Provider<javax.xml.stream.XMLInputFactory> xif, javax.ws.rs.ext.Providers ps, javax.ws.rs.core.MediaType mt)
-
-
Method Detail
-
getXMLStreamReader
protected final javax.xml.stream.XMLStreamReader getXMLStreamReader(java.lang.Class<?> elementType, javax.ws.rs.core.MediaType mediaType, javax.xml.bind.Unmarshaller u, java.io.InputStream entityStream) throws javax.xml.stream.XMLStreamExceptionDescription copied from class:AbstractCollectionJaxbProviderGet theXMLStreamReaderfor unmarshalling.- Specified by:
getXMLStreamReaderin classAbstractCollectionJaxbProvider- Parameters:
elementType- the individual element type.mediaType- the media type.u- the unmarshaller as a carrier of possible config options.entityStream- the input stream.- Returns:
- the XMLStreamReader.
- Throws:
javax.xml.stream.XMLStreamException- in caseXMLStreamReaderretrieval fails.
-
writeCollection
public final void writeCollection(java.lang.Class<?> elementType, java.util.Collection<?> t, javax.ws.rs.core.MediaType mediaType, java.nio.charset.Charset c, javax.xml.bind.Marshaller m, java.io.OutputStream entityStream) throws javax.xml.bind.JAXBException, java.io.IOExceptionDescription copied from class:AbstractCollectionJaxbProviderWrite a collection of JAXB objects as child elements of the root element.- Specified by:
writeCollectionin classAbstractCollectionJaxbProvider- Parameters:
elementType- the element type in the collection.t- the collection to marshallmediaType- the media typec- the charsetm- the marshallerentityStream- the output stream to marshall the collection- Throws:
javax.xml.bind.JAXBException- in case the marshalling of element collection fails.java.io.IOException- in case of any other I/O error while marshalling the collection of JAXB objects.
-
-