Package org.eclipse.persistence.jaxb
Class JAXBMarshaller
- java.lang.Object
-
- org.eclipse.persistence.jaxb.JAXBMarshaller
-
- All Implemented Interfaces:
javax.xml.bind.Marshaller
public class JAXBMarshaller extends java.lang.Object implements javax.xml.bind.MarshallerINTERNAL: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.
- Since:
- Oracle TopLink 11.1.1.0.0
- Author:
- mmacivor
- See Also:
Marshaller,MarshallerProperties,XMLMarshaller
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringXML_JAVATYPE_ADAPTERS
-
Constructor Summary
Constructors Constructor Description JAXBMarshaller(org.eclipse.persistence.oxm.XMLMarshaller newXMLMarshaller, JAXBContext jaxbContext)This constructor initializes various settings on the XML marshaller.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.xml.bind.annotation.adapters.XmlAdaptergetAdapter(java.lang.Class javaClass)javax.xml.bind.attachment.AttachmentMarshallergetAttachmentMarshaller()java.util.Set<ConstraintViolationWrapper<java.lang.Object>>getConstraintViolations()Returns constraint violations stored in the underlyingJAXBBeanValidatorinstance.javax.xml.bind.ValidationEventHandlergetEventHandler()JAXBContextgetJaxbContext()javax.xml.bind.Marshaller.ListenergetListener()org.w3c.dom.NodegetNode(java.lang.Object object)java.lang.ObjectgetProperty(java.lang.String key)Get a property from the JAXBMarshaller.javax.xml.validation.SchemagetSchema()org.eclipse.persistence.oxm.XMLMarshallergetXMLMarshaller()voidmarshal(java.lang.Object object, java.io.File file)voidmarshal(java.lang.Object object, java.io.OutputStream outputStream)voidmarshal(java.lang.Object object, java.io.Writer writer)voidmarshal(java.lang.Object object, javax.xml.stream.XMLEventWriter eventWriter)voidmarshal(java.lang.Object object, javax.xml.stream.XMLEventWriter eventWriter, TypeMappingInfo type)voidmarshal(java.lang.Object object, javax.xml.stream.XMLStreamWriter streamWriter)voidmarshal(java.lang.Object object, javax.xml.stream.XMLStreamWriter streamWriter, TypeMappingInfo type)voidmarshal(java.lang.Object object, javax.xml.transform.Result result)voidmarshal(java.lang.Object object, javax.xml.transform.Result result, TypeMappingInfo type)voidmarshal(java.lang.Object object, org.eclipse.persistence.oxm.record.MarshalRecord record)voidmarshal(java.lang.Object object, org.eclipse.persistence.oxm.record.MarshalRecord record, TypeMappingInfo type)voidmarshal(java.lang.Object object, org.w3c.dom.Node node)voidmarshal(java.lang.Object object, org.xml.sax.ContentHandler contentHandler)voidsetAdapter(java.lang.Class javaClass, javax.xml.bind.annotation.adapters.XmlAdapter adapter)voidsetAdapter(javax.xml.bind.annotation.adapters.XmlAdapter adapter)voidsetAttachmentMarshaller(javax.xml.bind.attachment.AttachmentMarshaller attachmentMarshaller)voidsetEventHandler(javax.xml.bind.ValidationEventHandler newValidationEventHandler)voidsetListener(javax.xml.bind.Marshaller.Listener listener)voidsetMarshalCallbacks(java.util.Map callbacks)voidsetProperty(java.lang.String key, java.lang.Object value)Set a property on the JAXBMarshaller.voidsetSchema(javax.xml.validation.Schema schema)
-
-
-
Field Detail
-
XML_JAVATYPE_ADAPTERS
public static final java.lang.String XML_JAVATYPE_ADAPTERS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JAXBMarshaller
public JAXBMarshaller(org.eclipse.persistence.oxm.XMLMarshaller newXMLMarshaller, JAXBContext jaxbContext)This constructor initializes various settings on the XML marshaller.- Parameters:
newXMLMarshaller- xml marshallerjaxbContext- jaxb context
-
-
Method Detail
-
getAdapter
public javax.xml.bind.annotation.adapters.XmlAdapter getAdapter(java.lang.Class javaClass)
- Specified by:
getAdapterin interfacejavax.xml.bind.Marshaller
-
getAttachmentMarshaller
public javax.xml.bind.attachment.AttachmentMarshaller getAttachmentMarshaller()
- Specified by:
getAttachmentMarshallerin interfacejavax.xml.bind.Marshaller
-
getEventHandler
public javax.xml.bind.ValidationEventHandler getEventHandler() throws javax.xml.bind.JAXBException- Specified by:
getEventHandlerin interfacejavax.xml.bind.Marshaller- Throws:
javax.xml.bind.JAXBException
-
getListener
public javax.xml.bind.Marshaller.Listener getListener()
- Specified by:
getListenerin interfacejavax.xml.bind.Marshaller
-
getNode
public org.w3c.dom.Node getNode(java.lang.Object object) throws javax.xml.bind.JAXBException- Specified by:
getNodein interfacejavax.xml.bind.Marshaller- Throws:
javax.xml.bind.JAXBException
-
getProperty
public java.lang.Object getProperty(java.lang.String key) throws javax.xml.bind.PropertyExceptionGet a property from the JAXBMarshaller. Attempting to get any unsupported property will result in a javax.xml.bind.PropertyException- Specified by:
getPropertyin interfacejavax.xml.bind.Marshaller- Throws:
javax.xml.bind.PropertyException- See Also:
MarshallerProperties
-
getSchema
public javax.xml.validation.Schema getSchema()
- Specified by:
getSchemain interfacejavax.xml.bind.Marshaller
-
marshal
public void marshal(java.lang.Object object, org.xml.sax.ContentHandler contentHandler) throws javax.xml.bind.JAXBException- Specified by:
marshalin interfacejavax.xml.bind.Marshaller- Throws:
javax.xml.bind.JAXBException
-
marshal
public void marshal(java.lang.Object object, javax.xml.stream.XMLEventWriter eventWriter) throws javax.xml.bind.JAXBException- Specified by:
marshalin interfacejavax.xml.bind.Marshaller- Throws:
javax.xml.bind.JAXBException
-
marshal
public void marshal(java.lang.Object object, javax.xml.stream.XMLEventWriter eventWriter, TypeMappingInfo type) throws javax.xml.bind.JAXBException- Throws:
javax.xml.bind.JAXBException
-
marshal
public void marshal(java.lang.Object object, org.w3c.dom.Node node) throws javax.xml.bind.JAXBException- Specified by:
marshalin interfacejavax.xml.bind.Marshaller- Throws:
javax.xml.bind.JAXBException
-
marshal
public void marshal(java.lang.Object object, java.io.OutputStream outputStream) throws javax.xml.bind.JAXBException- Specified by:
marshalin interfacejavax.xml.bind.Marshaller- Throws:
javax.xml.bind.JAXBException
-
marshal
public void marshal(java.lang.Object object, java.io.File file) throws javax.xml.bind.JAXBException- Specified by:
marshalin interfacejavax.xml.bind.Marshaller- Throws:
javax.xml.bind.JAXBException
-
marshal
public void marshal(java.lang.Object object, javax.xml.transform.Result result) throws javax.xml.bind.JAXBException- Specified by:
marshalin interfacejavax.xml.bind.Marshaller- Throws:
javax.xml.bind.JAXBException
-
marshal
public void marshal(java.lang.Object object, javax.xml.transform.Result result, TypeMappingInfo type) throws javax.xml.bind.JAXBException- Throws:
javax.xml.bind.JAXBException
-
marshal
public void marshal(java.lang.Object object, javax.xml.stream.XMLStreamWriter streamWriter) throws javax.xml.bind.JAXBException- Specified by:
marshalin interfacejavax.xml.bind.Marshaller- Throws:
javax.xml.bind.JAXBException
-
marshal
public void marshal(java.lang.Object object, javax.xml.stream.XMLStreamWriter streamWriter, TypeMappingInfo type) throws javax.xml.bind.JAXBException- Throws:
javax.xml.bind.JAXBException
-
marshal
public void marshal(java.lang.Object object, java.io.Writer writer) throws javax.xml.bind.JAXBException- Specified by:
marshalin interfacejavax.xml.bind.Marshaller- Throws:
javax.xml.bind.JAXBException
-
marshal
public void marshal(java.lang.Object object, org.eclipse.persistence.oxm.record.MarshalRecord record) throws javax.xml.bind.JAXBException- Throws:
javax.xml.bind.JAXBException
-
marshal
public void marshal(java.lang.Object object, org.eclipse.persistence.oxm.record.MarshalRecord record, TypeMappingInfo type) throws javax.xml.bind.JAXBException- Throws:
javax.xml.bind.JAXBException
-
setAdapter
public void setAdapter(java.lang.Class javaClass, javax.xml.bind.annotation.adapters.XmlAdapter adapter)- Specified by:
setAdapterin interfacejavax.xml.bind.Marshaller
-
setAdapter
public void setAdapter(javax.xml.bind.annotation.adapters.XmlAdapter adapter)
- Specified by:
setAdapterin interfacejavax.xml.bind.Marshaller
-
setAttachmentMarshaller
public void setAttachmentMarshaller(javax.xml.bind.attachment.AttachmentMarshaller attachmentMarshaller)
- Specified by:
setAttachmentMarshallerin interfacejavax.xml.bind.Marshaller
-
setEventHandler
public void setEventHandler(javax.xml.bind.ValidationEventHandler newValidationEventHandler) throws javax.xml.bind.JAXBException- Specified by:
setEventHandlerin interfacejavax.xml.bind.Marshaller- Throws:
javax.xml.bind.JAXBException
-
setListener
public void setListener(javax.xml.bind.Marshaller.Listener listener)
- Specified by:
setListenerin interfacejavax.xml.bind.Marshaller
-
setMarshalCallbacks
public void setMarshalCallbacks(java.util.Map callbacks)
-
setProperty
public void setProperty(java.lang.String key, java.lang.Object value) throws javax.xml.bind.PropertyExceptionSet a property on the JAXBMarshaller. Attempting to set any unsupported property will result in a javax.xml.bind.PropertyException- Specified by:
setPropertyin interfacejavax.xml.bind.Marshaller- Throws:
javax.xml.bind.PropertyException- See Also:
MarshallerProperties
-
setSchema
public void setSchema(javax.xml.validation.Schema schema)
- Specified by:
setSchemain interfacejavax.xml.bind.Marshaller
-
getJaxbContext
public JAXBContext getJaxbContext()
-
getXMLMarshaller
public org.eclipse.persistence.oxm.XMLMarshaller getXMLMarshaller()
-
getConstraintViolations
public java.util.Set<ConstraintViolationWrapper<java.lang.Object>> getConstraintViolations()
Returns constraint violations stored in the underlyingJAXBBeanValidatorinstance.- Returns:
- set of constraint violations from last unmarshal
-
-