Class XMLMarshaller

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class XMLMarshaller
    extends XMLMarshaller<AbstractSession,​CharacterEscapeHandler,​XMLContext,​XMLDescriptor,​XMLMarshalListener,​MediaType,​NamespacePrefixMapper,​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