Class XMLMarshaller

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class XMLMarshaller
    extends org.eclipse.persistence.internal.oxm.XMLMarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,​CharacterEscapeHandler,​XMLContext,​XMLDescriptor,​XMLMarshalListener,​MediaType,​NamespacePrefixMapper,​org.eclipse.persistence.internal.oxm.TreeObjectBuilder,​DatabaseSession>
    implements java.lang.Cloneable

    Class used to marshal object to XML.

    Create an XMLMarshaller from an XMLContext.
    Code Sample
    XMLContext context = new XMLContext("mySessionName");
    XMLMarshaller marshaller = context.createMarshaller();

    Objects can be marshalled to the following outputs:

    • java.io.OutputStream
    • java.io.Writer
    • javax.xml.transform.Result
    • org.w3c.dom.Node
    • org.xml.sax.ContentHandler

    Objects that can be marshalled are those which are mapped in the TopLink project associated with the XMLContext, and which are mapped to an XMLDescriptor that has a default root element specified.

    See Also:
    XMLContext
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.eclipse.persistence.internal.oxm.Marshaller

        org.eclipse.persistence.internal.oxm.Marshaller.Listener
    • Constructor Summary

      Constructors 
      Constructor Description
      XMLMarshaller​(XMLContext xmlContext)
      Create a new XMLMarshaller based on the specified session
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      XMLMarshaller clone()  
      CharacterEscapeHandler getCharacterEscapeHandler()
      Return this Marshaller's CharacterEscapeHandler.
      org.eclipse.persistence.internal.oxm.JsonTypeConfiguration getJsonTypeConfiguration()
      Returns json type configuration.
      XMLMarshalListener getMarshalListener()  
      MediaType getMediaType()
      Get the MediaType for this xmlMarshaller.
      NamespacePrefixMapper getNamespacePrefixMapper()
      NamespacePrefixMapper that can be used during marshal (instead of those set in the project meta data)
      java.util.Properties getProperties()
      Return a properties object for a given instance of the XMLMarshaller.
      XMLContext getXMLContext()
      Return the instance of XMLContext that was used to create this instance of XMLMarshaller.
      void marshal​(java.lang.Object object, javax.xml.transform.Result result)
      PUBLIC: Convert the given object to XML and update the given result with that XML Document
      org.w3c.dom.Document objectToXML​(java.lang.Object object, XMLDescriptor descriptor, XMLRecord xmlRow, boolean isXMLRoot, DocumentPreservationPolicy docPresPolicy)
      INTERNAL: Convert the given object to an XML Document
      org.w3c.dom.Document objectToXML​(java.lang.Object object, org.w3c.dom.Node parent)
      Deprecated. 
      org.w3c.dom.Document objectToXML​(java.lang.Object object, org.w3c.dom.Node parent, DocumentPreservationPolicy docPresPolicy)  
      org.w3c.dom.Document objectToXML​(java.lang.Object object, org.w3c.dom.Node rootNode, XMLDescriptor descriptor, XMLRecord xmlRow, boolean isXMLRoot, DocumentPreservationPolicy docPresPolicy)  
      void setCharacterEscapeHandler​(CharacterEscapeHandler c)
      Set this Marshaller's CharacterEscapeHandler.
      void setMarshalListener​(XMLMarshalListener listener)  
      void setMediaType​(MediaType mediaType)
      Set the MediaType for this xmlMarshaller.
      void setNamespacePrefixMapper​(NamespacePrefixMapper mapper)
      NamespacePrefixMapper that can be used during marshal (instead of those set in the project meta data)
      void setXMLContext​(XMLContext value)
      Set the XMLContext used by this instance of XMLMarshaller.
      void setXMLMarshalHandler​(XMLMarshalListener marshalListener)  
      • Methods inherited from class org.eclipse.persistence.internal.oxm.XMLMarshaller

        getAttachmentMarshaller, getAttributePrefix, getDescriptor, getMarshalAttributeGroup, getNamespaceSeparator, getNoNamespaceSchemaLocation, getSchema, getSchemaLocation, getTransformer, getValueWrapper, getXmlHeader, isApplicationJSON, isApplicationXML, isFragment, isIncludeRoot, isMarshalEmptyCollections, isReduceAnyArrays, isWrapperAsCollectionName, marshal, marshal, marshal, marshal, marshal, marshal, objectToXML, setAttachmentMarshaller, setAttributePrefix, setEncoding, setFormattedOutput, setFragment, setIncludeRoot, setMarshalAttributeGroup, setMarshalEmptyCollections, setNamespaceSeparator, setNoNamespaceSchemaLocation, setReduceAnyArrays, setSchema, setSchemaLocation, setValueWrapper, setWrapperAsCollectionName, setXmlHeader
      • Methods inherited from class org.eclipse.persistence.internal.oxm.Marshaller

        getContext, getEncoding, getErrorHandler, getIndentString, getProperty, isEqualUsingIdenity, isFormattedOutput, setEqualUsingIdenity, setErrorHandler, setIndentString
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait