Package com.tangosol.coherence.rest.io
Class JaxbXmlMarshaller<T>
java.lang.Object
com.tangosol.coherence.rest.io.AbstractMarshaller<T>
com.tangosol.coherence.rest.io.JaxbXmlMarshaller<T>
- All Implemented Interfaces:
- Marshaller<T>
- Direct Known Subclasses:
- XmlJaxbMarshaller
JAXB-based marshaller that marshals object to/from XML.
- Author:
- as 2011.07.10
- 
Field SummaryFields inherited from interface com.tangosol.coherence.rest.io.MarshallerFORMAT_OUTPUT
- 
Constructor SummaryConstructorsConstructorDescriptionJaxbXmlMarshaller(Class<T> clzRoot) Construct an JaxbXmlMarshaller instance.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidconfigureJaxbMarshaller(jakarta.xml.bind.Marshaller marshaller) Configure a JAXB marshaller.protected voidconfigureJaxbUnmarshaller(jakarta.xml.bind.Unmarshaller unmarshaller) Configure a JAXB unmarshaller.voidmarshal(T value, OutputStream out, jakarta.ws.rs.core.MultivaluedMap<String, Object> httpHeaders) Write the specified object into the given stream.voidmarshalAsFragment(T value, OutputStream out, jakarta.ws.rs.core.MultivaluedMap<String, Object> httpHeaders) Write the specified object into the given stream as a fragment.unmarshal(InputStream in, jakarta.ws.rs.core.MediaType mediaType) Read an object from the specified stream.Methods inherited from class com.tangosol.coherence.rest.io.AbstractMarshallergetRootClass
- 
Constructor Details- 
JaxbXmlMarshallerConstruct an JaxbXmlMarshaller instance.- Parameters:
- clzRoot- class of the root object this marshaller is for
 
 
- 
- 
Method Details- 
marshalpublic void marshal(T value, OutputStream out, jakarta.ws.rs.core.MultivaluedMap<String, Object> httpHeaders) throws IOExceptionDescription copied from interface:MarshallerWrite the specified object into the given stream.- Parameters:
- value- object to marshall
- out- the- OutputStreamfor the HTTP entity. The implementation should not close the output stream.
- httpHeaders- a mutable map of the HTTP message headers.
- Throws:
- IOException- if an error occurs during marshalling
 
- 
marshalAsFragmentpublic void marshalAsFragment(T value, OutputStream out, jakarta.ws.rs.core.MultivaluedMap<String, Object> httpHeaders) throws IOExceptionDescription copied from interface:MarshallerWrite the specified object into the given stream as a fragment.This method is called when marshalling collections of objects, as marshalling behavior might differ when an object is serialized directly or as element of a collection. For example, when marshalling a collection of objects into XML, you need to ensure that the XML declaration is emmitted only once, not for each object in the collection. In cases where there is no difference in output between fragments and full objects (JSON, for example), this method could simply delegate to Marshaller.marshal(Object, OutputStream, MultivaluedMap).- Parameters:
- value- object to marshall
- out- the- OutputStreamfor the HTTP entity. The implementation should not close the output stream.
- httpHeaders- a mutable map of the HTTP message headers.
- Throws:
- IOException- if an error occurs during marshalling
 
- 
unmarshalDescription copied from interface:MarshallerRead an object from the specified stream.- Parameters:
- in- stream to read from
- mediaType- the media type of the object to read
- Returns:
- unmarshalled object instance
- Throws:
- IOException- if an error occurs during unmarshalling
 
- 
configureJaxbMarshallerprotected void configureJaxbMarshaller(jakarta.xml.bind.Marshaller marshaller) throws jakarta.xml.bind.PropertyException Configure a JAXB marshaller.- Parameters:
- marshaller- marshaller to configure
- Throws:
- jakarta.xml.bind.PropertyException- when there is an error processing a property or value
 
- 
configureJaxbUnmarshallerprotected void configureJaxbUnmarshaller(jakarta.xml.bind.Unmarshaller unmarshaller) throws jakarta.xml.bind.PropertyException Configure a JAXB unmarshaller.- Parameters:
- unmarshaller- unmarshaller to configure
- Throws:
- jakarta.xml.bind.PropertyException- when there is an error processing a property or value
 
 
-