Class JettisonListElementProvider
java.lang.Object
org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider<T>
org.glassfish.jersey.jaxb.internal.AbstractJaxbProvider<Object>
org.glassfish.jersey.jaxb.internal.AbstractCollectionJaxbProvider
org.glassfish.jersey.jettison.internal.entity.JettisonListElementProvider
- All Implemented Interfaces:
MessageBodyReader<Object>
,MessageBodyWriter<Object>
- Direct Known Subclasses:
JettisonListElementProvider.App
,JettisonListElementProvider.General
JSON message entity media type provider (reader & writer) for collection
types.
- Author:
- Jakub Podlesak
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
static final class
Nested classes/interfaces inherited from class org.glassfish.jersey.jaxb.internal.AbstractCollectionJaxbProvider
AbstractCollectionJaxbProvider.JaxbTypeChecker
-
Field Summary
Fields inherited from class org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider
UTF8
-
Method Summary
Modifier and TypeMethodDescriptionprotected final XMLStreamReader
getXMLStreamReader
(Class<?> elementType, MediaType mediaType, jakarta.xml.bind.Unmarshaller u, InputStream entityStream) Get theXMLStreamReader
for unmarshalling.boolean
isReadable
(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) boolean
isWriteable
(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) final void
writeCollection
(Class<?> elementType, Collection<?> t, MediaType mediaType, Charset c, jakarta.xml.bind.Marshaller m, 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, 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
-
Method Details
-
isReadable
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) - Specified by:
isReadable
in interfaceMessageBodyReader<Object>
- Overrides:
isReadable
in classAbstractCollectionJaxbProvider
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) - Specified by:
isWriteable
in interfaceMessageBodyWriter<Object>
- Overrides:
isWriteable
in classAbstractCollectionJaxbProvider
-
writeCollection
public final void writeCollection(Class<?> elementType, Collection<?> t, MediaType mediaType, Charset c, jakarta.xml.bind.Marshaller m, OutputStream entityStream) throws jakarta.xml.bind.JAXBException, IOException Description copied from class:AbstractCollectionJaxbProvider
Write a collection of JAXB objects as child elements of the root element.- Specified by:
writeCollection
in 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:
jakarta.xml.bind.JAXBException
- in case the marshalling of element collection fails.IOException
- in case of any other I/O error while marshalling the collection of JAXB objects.
-
getXMLStreamReader
protected final XMLStreamReader getXMLStreamReader(Class<?> elementType, MediaType mediaType, jakarta.xml.bind.Unmarshaller u, InputStream entityStream) throws XMLStreamException Description copied from class:AbstractCollectionJaxbProvider
Get theXMLStreamReader
for unmarshalling.- Specified by:
getXMLStreamReader
in 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:
XMLStreamException
- in caseXMLStreamReader
retrieval fails.
-