Class XMLMarshaller

  • All Implemented Interfaces:
    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 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
    • Field Summary

      • Fields inherited from class org.eclipse.persistence.internal.oxm.XMLMarshaller

        attachmentMarshaller, DEFAULT_XML_VERSION, domToEventWriterClass, domToStreamWriterClass, mediaType, staxResultClass, staxResultGetEventWriterMethod, staxResultGetStreamWriterMethod, transformer, writeToEventWriterMethod, writeToStreamMethod
      • Fields inherited from class org.eclipse.persistence.internal.oxm.Marshaller

        context, mapper, marshalProperties