org.glassfish.jersey.message.internal
Class XmlCollectionJaxbProvider
java.lang.Object
org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider<T>
org.glassfish.jersey.message.internal.AbstractJaxbProvider<java.lang.Object>
org.glassfish.jersey.message.internal.AbstractCollectionJaxbProvider
org.glassfish.jersey.message.internal.XmlCollectionJaxbProvider
- All Implemented Interfaces:
- MessageBodyReader<java.lang.Object>, 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.
- 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. |
|
Method Summary |
protected javax.xml.stream.XMLStreamReader |
getXMLStreamReader(java.lang.Class<?> elementType,
MediaType mediaType,
javax.xml.bind.Unmarshaller u,
java.io.InputStream entityStream)
Get the XMLStreamReader for unmarshalling. |
void |
writeList(java.lang.Class<?> elementType,
java.util.Collection<?> t,
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getXMLStreamReader
protected final javax.xml.stream.XMLStreamReader getXMLStreamReader(java.lang.Class<?> elementType,
MediaType mediaType,
javax.xml.bind.Unmarshaller u,
java.io.InputStream entityStream)
throws javax.xml.stream.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:
javax.xml.stream.XMLStreamException
writeList
public final void writeList(java.lang.Class<?> elementType,
java.util.Collection<?> t,
MediaType mediaType,
java.nio.charset.Charset c,
javax.xml.bind.Marshaller m,
java.io.OutputStream entityStream)
throws javax.xml.bind.JAXBException,
java.io.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 marshallmediaType - the media typec - the charsetm - the marshallerentityStream - the output stream to marshall the collection
- Throws:
javax.xml.bind.JAXBException
java.io.IOException
Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.