public class Marshaller<T> extends Object
marshal
method takes a different target for the XML.
This class is a factory that constructs an instance of itself for multiple
uses. The created instance is thread safe and is optimized to be used for
multiple, possibly concurrent calls.Constructor and Description |
---|
Marshaller(JaxbRepresentation<T> jaxbRepresentation) |
Marshaller(JaxbRepresentation<T> jaxbRepresentation,
String contextPath,
ClassLoader classLoader)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ClassLoader |
getClassLoader()
Returns the JAXB classloader.
|
String |
getContextPath()
Returns the JAXB context path.
|
JaxbRepresentation<T> |
getJaxbRepresentation()
Returns the parent JAXB representation.
|
void |
marshal(Object jaxbElement,
OutputStream stream)
Marshals the content tree rooted at
jaxbElement into an output
stream. |
void |
marshal(Object jaxbElement,
Writer writer)
Marshal the content tree rooted at
jaxbElement into a writer. |
public Marshaller(JaxbRepresentation<T> jaxbRepresentation)
public Marshaller(JaxbRepresentation<T> jaxbRepresentation, String contextPath, ClassLoader classLoader)
jaxbRepresentation
- The JAXB representation to marshal.contextPath
- The JAXB context path.classLoader
- The JAXB classloader.public ClassLoader getClassLoader()
public String getContextPath()
public JaxbRepresentation<T> getJaxbRepresentation()
public void marshal(Object jaxbElement, OutputStream stream) throws JAXBException
jaxbElement
into an output
stream.jaxbElement
- The root of the content tree to be marshalled.stream
- The target output stream write the XML to.JAXBException
- If any unexpected problem occurs during marshalling.public void marshal(Object jaxbElement, Writer writer) throws JAXBException
jaxbElement
into a writer.jaxbElement
- The root of the content tree to be marshaled.writer
- The target writer to write the XML to.JAXBException
- If any unexpected problem occurs during marshaling.Copyright © 2005–2017. All rights reserved.