org.glassfish.jersey.message.internal
Class XmlCollectionJaxbProvider

java.lang.Object
  extended by org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider<T>
      extended by org.glassfish.jersey.message.internal.AbstractJaxbProvider<Object>
          extended by org.glassfish.jersey.message.internal.AbstractCollectionJaxbProvider
              extended by org.glassfish.jersey.message.internal.XmlCollectionJaxbProvider
All Implemented Interfaces:
MessageBodyReader<Object>, MessageBodyWriter<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.

Author:
Paul Sandoz, Marek Potociar (marek.potociar at oracle.com)

Nested Class Summary
static class XmlCollectionJaxbProvider.App
          JAXB provider for marshalling/un-marshalling collections from/to entities of application/xml media type.
static class XmlCollectionJaxbProvider.General
          JAXB provider for marshalling/un-marshalling collections from/to entities of <type>/<sub-type>+xml media types.
static class XmlCollectionJaxbProvider.Text
          JAXB provider for marshalling/un-marshalling collections from/to entities of text/xml media type.
 
Nested classes/interfaces inherited from class org.glassfish.jersey.message.internal.AbstractCollectionJaxbProvider
AbstractCollectionJaxbProvider.JaxbTypeChecker
 
Field Summary
 
Fields inherited from class org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider
UTF8
 
Method Summary
protected  XMLStreamReader getXMLStreamReader(Class<?> elementType, MediaType mediaType, Unmarshaller u, InputStream entityStream)
          Get the XMLStreamReader for unmarshalling.
 void writeList(Class<?> elementType, Collection<?> t, MediaType mediaType, Charset c, Marshaller m, OutputStream entityStream)
          Write a collection of JAXB objects as child elements of the root element.
 
Methods inherited from class org.glassfish.jersey.message.internal.AbstractCollectionJaxbProvider
getElementClass, getElementName, getRootElementName, isReadable, isWriteable, readFrom, verifyArrayType, verifyCollectionSubclass, verifyGenericType, writeTo
 
Methods inherited from class org.glassfish.jersey.message.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getXMLStreamReader

protected final XMLStreamReader getXMLStreamReader(Class<?> elementType,
                                                   MediaType mediaType,
                                                   Unmarshaller u,
                                                   InputStream entityStream)
                                            throws XMLStreamException
Description copied from class: AbstractCollectionJaxbProvider
Get the XMLStreamReader for unmarshalling.

Specified by:
getXMLStreamReader in class AbstractCollectionJaxbProvider
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:
XMLStreamException

writeList

public final void writeList(Class<?> elementType,
                            Collection<?> t,
                            MediaType mediaType,
                            Charset c,
                            Marshaller m,
                            OutputStream entityStream)
                     throws JAXBException,
                            IOException
Description copied from class: AbstractCollectionJaxbProvider
Write a collection of JAXB objects as child elements of the root element.

Specified by:
writeList in class AbstractCollectionJaxbProvider
Parameters:
elementType - the element type in the collection.
t - the collecton to marshall
mediaType - the media type
c - the charset
m - the marshaller
entityStream - the output stream to marshall the collection
Throws:
JAXBException
IOException


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.