Package org.eclipse.persistence.jaxb
Class JAXBMarshaller
java.lang.Object
org.eclipse.persistence.jaxb.JAXBMarshaller
- All Implemented Interfaces:
jakarta.xml.bind.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.1/2.2 Marshaller interface provides the required functionality by acting as a thin wrapper on the existing XMLMarshaller API.
- See Also:
-
Marshaller
MarshallerProperties
XMLMarshaller
- Author:
- mmacivor
-
Nested Class Summary
Nested classes/interfaces inherited from interface jakarta.xml.bind.Marshaller
jakarta.xml.bind.Marshaller.Listener
-
Field Summary
Fields inherited from interface jakarta.xml.bind.Marshaller
JAXB_ENCODING, JAXB_FORMATTED_OUTPUT, JAXB_FRAGMENT, JAXB_NO_NAMESPACE_SCHEMA_LOCATION, JAXB_SCHEMA_LOCATION
-
Constructor Summary
ConstructorDescriptionJAXBMarshaller
(XMLMarshaller newXMLMarshaller, JAXBContext jaxbContext) This constructor initializes various settings on the XML marshaller. -
Method Summary
Modifier and TypeMethodDescriptionjakarta.xml.bind.annotation.adapters.XmlAdapter
getAdapter
(Class javaClass) jakarta.xml.bind.attachment.AttachmentMarshaller
Returns constraint violations stored in the underlyingJAXBBeanValidator
instance.jakarta.xml.bind.ValidationEventHandler
jakarta.xml.bind.Marshaller.Listener
getProperty
(String key) Get a property from the JAXBMarshaller.void
void
marshal
(Object object, OutputStream outputStream) void
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
void
marshal
(Object object, Result result, TypeMappingInfo type) void
marshal
(Object object, MarshalRecord record) void
marshal
(Object object, MarshalRecord record, TypeMappingInfo type) void
void
marshal
(Object object, ContentHandler contentHandler) void
setAdapter
(jakarta.xml.bind.annotation.adapters.XmlAdapter adapter) void
setAdapter
(Class javaClass, jakarta.xml.bind.annotation.adapters.XmlAdapter adapter) void
setAttachmentMarshaller
(jakarta.xml.bind.attachment.AttachmentMarshaller attachmentMarshaller) void
setEventHandler
(jakarta.xml.bind.ValidationEventHandler newValidationEventHandler) void
setListener
(jakarta.xml.bind.Marshaller.Listener listener) void
setMarshalCallbacks
(Map callbacks) void
setProperty
(String key, Object value) Set a property on the JAXBMarshaller.void
-
Field Details
-
XML_JAVATYPE_ADAPTERS
- See Also:
-
-
Constructor Details
-
JAXBMarshaller
This constructor initializes various settings on the XML marshaller.- Parameters:
newXMLMarshaller
- xml marshallerjaxbContext
- jaxb context
-
-
Method Details
-
getAdapter
- Specified by:
getAdapter
in interfacejakarta.xml.bind.Marshaller
-
getAttachmentMarshaller
public jakarta.xml.bind.attachment.AttachmentMarshaller getAttachmentMarshaller()- Specified by:
getAttachmentMarshaller
in interfacejakarta.xml.bind.Marshaller
-
getEventHandler
public jakarta.xml.bind.ValidationEventHandler getEventHandler() throws jakarta.xml.bind.JAXBException- Specified by:
getEventHandler
in interfacejakarta.xml.bind.Marshaller
- Throws:
jakarta.xml.bind.JAXBException
-
getListener
public jakarta.xml.bind.Marshaller.Listener getListener()- Specified by:
getListener
in interfacejakarta.xml.bind.Marshaller
-
getNode
- Specified by:
getNode
in interfacejakarta.xml.bind.Marshaller
- Throws:
jakarta.xml.bind.JAXBException
-
getProperty
Get a property from the JAXBMarshaller. Attempting to get any unsupported property will result in a jakarta.xml.bind.PropertyException- Specified by:
getProperty
in interfacejakarta.xml.bind.Marshaller
- Throws:
jakarta.xml.bind.PropertyException
- See Also:
-
getSchema
- Specified by:
getSchema
in interfacejakarta.xml.bind.Marshaller
-
marshal
public void marshal(Object object, ContentHandler contentHandler) throws jakarta.xml.bind.JAXBException - Specified by:
marshal
in interfacejakarta.xml.bind.Marshaller
- Throws:
jakarta.xml.bind.JAXBException
-
marshal
public void marshal(Object object, XMLEventWriter eventWriter) throws jakarta.xml.bind.JAXBException - Specified by:
marshal
in interfacejakarta.xml.bind.Marshaller
- Throws:
jakarta.xml.bind.JAXBException
-
marshal
public void marshal(Object object, XMLEventWriter eventWriter, TypeMappingInfo type) throws jakarta.xml.bind.JAXBException - Throws:
jakarta.xml.bind.JAXBException
-
marshal
- Specified by:
marshal
in interfacejakarta.xml.bind.Marshaller
- Throws:
jakarta.xml.bind.JAXBException
-
marshal
- Specified by:
marshal
in interfacejakarta.xml.bind.Marshaller
- Throws:
jakarta.xml.bind.JAXBException
-
marshal
- Specified by:
marshal
in interfacejakarta.xml.bind.Marshaller
- Throws:
jakarta.xml.bind.JAXBException
-
marshal
- Specified by:
marshal
in interfacejakarta.xml.bind.Marshaller
- Throws:
jakarta.xml.bind.JAXBException
-
marshal
public void marshal(Object object, Result result, TypeMappingInfo type) throws jakarta.xml.bind.JAXBException - Throws:
jakarta.xml.bind.JAXBException
-
marshal
public void marshal(Object object, XMLStreamWriter streamWriter) throws jakarta.xml.bind.JAXBException - Specified by:
marshal
in interfacejakarta.xml.bind.Marshaller
- Throws:
jakarta.xml.bind.JAXBException
-
marshal
public void marshal(Object object, XMLStreamWriter streamWriter, TypeMappingInfo type) throws jakarta.xml.bind.JAXBException - Throws:
jakarta.xml.bind.JAXBException
-
marshal
- Specified by:
marshal
in interfacejakarta.xml.bind.Marshaller
- Throws:
jakarta.xml.bind.JAXBException
-
marshal
- Throws:
jakarta.xml.bind.JAXBException
-
marshal
public void marshal(Object object, MarshalRecord record, TypeMappingInfo type) throws jakarta.xml.bind.JAXBException - Throws:
jakarta.xml.bind.JAXBException
-
setAdapter
- Specified by:
setAdapter
in interfacejakarta.xml.bind.Marshaller
-
setAdapter
public void setAdapter(jakarta.xml.bind.annotation.adapters.XmlAdapter adapter) - Specified by:
setAdapter
in interfacejakarta.xml.bind.Marshaller
-
setAttachmentMarshaller
public void setAttachmentMarshaller(jakarta.xml.bind.attachment.AttachmentMarshaller attachmentMarshaller) - Specified by:
setAttachmentMarshaller
in interfacejakarta.xml.bind.Marshaller
-
setEventHandler
public void setEventHandler(jakarta.xml.bind.ValidationEventHandler newValidationEventHandler) throws jakarta.xml.bind.JAXBException - Specified by:
setEventHandler
in interfacejakarta.xml.bind.Marshaller
- Throws:
jakarta.xml.bind.JAXBException
-
setListener
public void setListener(jakarta.xml.bind.Marshaller.Listener listener) - Specified by:
setListener
in interfacejakarta.xml.bind.Marshaller
-
setMarshalCallbacks
-
setProperty
Set a property on the JAXBMarshaller. Attempting to set any unsupported property will result in a jakarta.xml.bind.PropertyException- Specified by:
setProperty
in interfacejakarta.xml.bind.Marshaller
- Throws:
jakarta.xml.bind.PropertyException
- See Also:
-
setSchema
- Specified by:
setSchema
in interfacejakarta.xml.bind.Marshaller
-
getJaxbContext
-
getXMLMarshaller
-
getConstraintViolations
Returns constraint violations stored in the underlyingJAXBBeanValidator
instance.- Returns:
- set of constraint violations from last unmarshal
-