org.eclipse.persistence.jaxb
Class JAXBMarshaller
java.lang.Object
org.eclipse.persistence.jaxb.JAXBMarshaller
- All Implemented Interfaces:
- Marshaller
public class JAXBMarshaller
- extends Object
- implements Marshaller
INTERNAL:
Purpose:To Provide an implementation of the JAXB 2.0 Marshaller Interface
Responsibilities:
- Provide a JAXB wrapper on the XMLMarshaller API
- Perform Object to XML Conversions
This implementation of the JAXB 2.0 Marshaller interface provides the required functionality
by acting as a thin wrapper on the existing XMLMarshaller API.
- Since:
- Oracle TopLink 11.1.1.0.0
- Author:
- mmacivor
- See Also:
Marshaller
,
XMLMarshaller
Constructor Summary |
JAXBMarshaller(XMLMarshaller newXMLMarshaller,
JAXBIntrospector newIntrospector)
This constructor initializes various settings on the XML marshaller, and
stores the provided JAXBIntrospector instance for usage in marshal()
calls. |
Method Summary |
XmlAdapter |
getAdapter(Class javaClass)
|
AttachmentMarshaller |
getAttachmentMarshaller()
|
ValidationEventHandler |
getEventHandler()
|
Marshaller.Listener |
getListener()
|
Node |
getNode(Object object)
|
Object |
getProperty(String key)
|
Schema |
getSchema()
|
XMLMarshaller |
getXMLMarshaller()
|
void |
marshal(Object object,
ContentHandler contentHandler)
|
void |
marshal(Object object,
File file)
|
void |
marshal(Object object,
Node node)
|
void |
marshal(Object object,
OutputStream outputStream)
|
void |
marshal(Object object,
Result result)
|
void |
marshal(Object object,
Result result,
TypeMappingInfo type)
|
void |
marshal(Object object,
Writer writer)
|
void |
marshal(Object object,
XMLEventWriter eventWriter)
|
void |
marshal(Object object,
XMLEventWriter eventWriter,
TypeMappingInfo type)
|
void |
marshal(Object object,
XMLStreamWriter streamWriter)
|
void |
marshal(Object object,
XMLStreamWriter streamWriter,
TypeMappingInfo type)
|
void |
setAdapter(Class javaClass,
XmlAdapter adapter)
|
void |
setAdapter(XmlAdapter adapter)
|
void |
setAttachmentMarshaller(AttachmentMarshaller attachmentMarshaller)
|
void |
setEventHandler(ValidationEventHandler newValidationEventHandler)
|
void |
setJaxbContext(JAXBContext jaxbContext)
|
void |
setListener(Marshaller.Listener listener)
|
void |
setMarshalCallbacks(HashMap callbacks)
|
void |
setProperty(String key,
Object value)
|
void |
setQNameToGeneratedClasses(HashMap<QName,Class> qNameToClass)
|
void |
setSchema(Schema schema)
|
XML_JAVATYPE_ADAPTERS
public static final String XML_JAVATYPE_ADAPTERS
- See Also:
- Constant Field Values
JAXBMarshaller
public JAXBMarshaller(XMLMarshaller newXMLMarshaller,
JAXBIntrospector newIntrospector)
- This constructor initializes various settings on the XML marshaller, and
stores the provided JAXBIntrospector instance for usage in marshal()
calls.
- Parameters:
newXMLMarshaller
- newIntrospector
-
getAdapter
public XmlAdapter getAdapter(Class javaClass)
- Specified by:
getAdapter
in interface Marshaller
getAttachmentMarshaller
public AttachmentMarshaller getAttachmentMarshaller()
- Specified by:
getAttachmentMarshaller
in interface Marshaller
getEventHandler
public ValidationEventHandler getEventHandler()
throws JAXBException
- Specified by:
getEventHandler
in interface Marshaller
- Throws:
JAXBException
getListener
public Marshaller.Listener getListener()
- Specified by:
getListener
in interface Marshaller
getNode
public Node getNode(Object object)
throws JAXBException
- Specified by:
getNode
in interface Marshaller
- Throws:
JAXBException
getProperty
public Object getProperty(String key)
throws PropertyException
- Specified by:
getProperty
in interface Marshaller
- Throws:
PropertyException
getSchema
public Schema getSchema()
- Specified by:
getSchema
in interface Marshaller
marshal
public void marshal(Object object,
ContentHandler contentHandler)
throws JAXBException
- Specified by:
marshal
in interface Marshaller
- Throws:
JAXBException
marshal
public void marshal(Object object,
XMLEventWriter eventWriter)
throws JAXBException
- Specified by:
marshal
in interface Marshaller
- Throws:
JAXBException
marshal
public void marshal(Object object,
XMLEventWriter eventWriter,
TypeMappingInfo type)
throws JAXBException
- Throws:
JAXBException
marshal
public void marshal(Object object,
Node node)
throws JAXBException
- Specified by:
marshal
in interface Marshaller
- Throws:
JAXBException
marshal
public void marshal(Object object,
OutputStream outputStream)
throws JAXBException
- Specified by:
marshal
in interface Marshaller
- Throws:
JAXBException
marshal
public void marshal(Object object,
File file)
throws JAXBException
- Specified by:
marshal
in interface Marshaller
- Throws:
JAXBException
marshal
public void marshal(Object object,
Result result)
throws JAXBException
- Specified by:
marshal
in interface Marshaller
- Throws:
JAXBException
marshal
public void marshal(Object object,
Result result,
TypeMappingInfo type)
throws JAXBException
- Throws:
JAXBException
marshal
public void marshal(Object object,
XMLStreamWriter streamWriter)
throws JAXBException
- Specified by:
marshal
in interface Marshaller
- Throws:
JAXBException
marshal
public void marshal(Object object,
XMLStreamWriter streamWriter,
TypeMappingInfo type)
throws JAXBException
- Throws:
JAXBException
marshal
public void marshal(Object object,
Writer writer)
throws JAXBException
- Specified by:
marshal
in interface Marshaller
- Throws:
JAXBException
setAdapter
public void setAdapter(Class javaClass,
XmlAdapter adapter)
- Specified by:
setAdapter
in interface Marshaller
setAdapter
public void setAdapter(XmlAdapter adapter)
- Specified by:
setAdapter
in interface Marshaller
setAttachmentMarshaller
public void setAttachmentMarshaller(AttachmentMarshaller attachmentMarshaller)
- Specified by:
setAttachmentMarshaller
in interface Marshaller
setEventHandler
public void setEventHandler(ValidationEventHandler newValidationEventHandler)
throws JAXBException
- Specified by:
setEventHandler
in interface Marshaller
- Throws:
JAXBException
setListener
public void setListener(Marshaller.Listener listener)
- Specified by:
setListener
in interface Marshaller
setMarshalCallbacks
public void setMarshalCallbacks(HashMap callbacks)
setProperty
public void setProperty(String key,
Object value)
throws PropertyException
- Specified by:
setProperty
in interface Marshaller
- Throws:
PropertyException
setSchema
public void setSchema(Schema schema)
- Specified by:
setSchema
in interface Marshaller
setQNameToGeneratedClasses
public void setQNameToGeneratedClasses(HashMap<QName,Class> qNameToClass)
setJaxbContext
public void setJaxbContext(JAXBContext jaxbContext)
getXMLMarshaller
public XMLMarshaller getXMLMarshaller()