org.eclipse.persistence.oxm

Class XMLMarshaller

    • Constructor Detail

      • XMLMarshaller

        public XMLMarshaller(XMLContext xmlContext)
        Create a new XMLMarshaller based on the specified session
        Parameters:
        session - A single session
    • Method Detail

      • getXMLContext

        public XMLContext getXMLContext()
        Return the instance of XMLContext that was used to create this instance of XMLMarshaller.
      • setXMLContext

        public void setXMLContext(XMLContext value)
        Set the XMLContext used by this instance of XMLMarshaller.
      • setErrorHandler

        public void setErrorHandler(ErrorHandler errorHandler)
      • isFormattedOutput

        public boolean isFormattedOutput()
        Returns if this XMLMarshaller should format the XML By default this is set to true and the XML marshalled will be formatted.
        Returns:
        if this XMLMarshaller should format the XML
      • setFormattedOutput

        public void setFormattedOutput(boolean shouldFormat)
        Set if this XMLMarshaller should format the XML By default this is set to true and the XML marshalled will be formatted.
        Parameters:
        shouldFormat - if this XMLMarshaller should format the XML
      • getEncoding

        public String getEncoding()
        Get the encoding set on this XMLMarshaller If the encoding has not been set the default UTF-8 will be used
        Returns:
        the encoding set on this XMLMarshaller
      • setEncoding

        public void setEncoding(String newEncoding)
        Set the encoding on this XMLMarshaller If the encoding is not set the default UTF-8 will be used
        Parameters:
        newEncoding - the encoding to set on this XMLMarshaller
      • getSchemaLocation

        public String getSchemaLocation()
        Get the schema location set on this XMLMarshaller
        Returns:
        the schema location specified on this XMLMarshaller
      • setSchemaLocation

        public void setSchemaLocation(String newSchemaLocation)
        Set the schema location on this XMLMarshaller
        Parameters:
        newSchemaLocation - the schema location to be seton this XMLMarshaller
      • getNoNamespaceSchemaLocation

        public String getNoNamespaceSchemaLocation()
        Get the no namespace schema location set on this XMLMarshaller
        Returns:
        the no namespace schema location specified on this XMLMarshaller
      • getProperties

        public Properties getProperties()
        Return a properties object for a given instance of the XMLMarshaller.
        Returns:
      • getProperty

        public Object getProperty(Object key)
        Return the property for a given key, if one exists.
        Returns:
      • setNoNamespaceSchemaLocation

        public void setNoNamespaceSchemaLocation(String newNoNamespaceSchemaLocation)
        Set the no namespace schema location on this XMLMarshaller
        Parameters:
        newNoNamespaceSchemaLocation - no namespace schema location to be seton this XMLMarshaller
      • setXMLMarshalHandler

        public void setXMLMarshalHandler(XMLMarshalListener marshalListener)
      • marshal

        public void marshal(Object object,
                   Result result)
                     throws XMLMarshalException
        PUBLIC: Convert the given object to XML and update the given result with that XML Document
        Parameters:
        object - the object to marshal
        result - the result to marshal the object to
        Throws:
        XMLMarshalException - if an error occurred during marshalling
      • marshal

        public void marshal(Object object,
                   OutputStream outputStream)
                     throws XMLMarshalException
        PUBLIC: Convert the given object to XML and update the given outputStream with that XML Document
        Parameters:
        object - the object to marshal
        outputStream - the outputStream to marshal the object to
        Throws:
        XMLMarshalException - if an error occurred during marshalling
      • marshal

        public void marshal(Object object,
                   Writer writer)
                     throws XMLMarshalException
        PUBLIC: Convert the given object to XML and update the given writer with that XML Document
        Parameters:
        object - the object to marshal
        writer - the writer to marshal the object to
        Throws:
        XMLMarshalException - if an error occurred during marshalling
      • marshal

        public void marshal(Object object,
                   ContentHandler contentHandler)
                     throws XMLMarshalException
        PUBLIC: Convert the given object to XML and update the given contentHandler with that XML Document
        Parameters:
        object - the object to marshal
        contentHandler - the contentHandler which the specified object should be marshalled to
        Throws:
        XMLMarshalException - if an error occurred during marshalling
      • marshal

        public void marshal(Object object,
                   ContentHandler contentHandler,
                   LexicalHandler lexicalHandler)
                     throws XMLMarshalException
        PUBLIC: Convert the given object to XML and update the given contentHandler with that XML Document
        Parameters:
        object - the object to marshal
        contentHandler - the contentHandler which the specified object should be marshalled to
        Throws:
        XMLMarshalException - if an error occurred during marshalling
      • marshal

        public void marshal(Object object,
                   Node node)
                     throws XMLMarshalException
        PUBLIC: Convert the given object to XML and update the given node with that XML Document
        Parameters:
        object - the object to marshal
        node - the node which the specified object should be marshalled to
        Throws:
        XMLMarshalException - if an error occurred during marshalling
      • marshal

        public void marshal(Object object,
                   MarshalRecord marshalRecord)
        Convert the given object to XML and update the given marshal record with that XML Document.
        Parameters:
        object - the object to marshal
        marshalRecord - the marshalRecord to marshal the object to
      • objectToXML

        public Document objectToXML(Object object)
                             throws XMLMarshalException
        PUBLIC: Convert the given object to an XML Document
        Parameters:
        object - the object to marshal
        Returns:
        the document which the specified object has been marshalled to
        Throws:
        XMLMarshalException - if an error occurred during marshalling
      • objectToXML

        public Document objectToXML(Object object,
                           Node parent)
                             throws XMLMarshalException
        Deprecated. 
        PUBLIC: Convert the given object to descendants of the parent element
        Parameters:
        object - the object to marshal
        parent - the node to marshal the object to
        Returns:
        the document which the specified object has been marshalled to
        Throws:
        XMLMarshalException - if an error occurred during marshalling
      • setFragment

        public void setFragment(boolean fragment)
        PUBLIC: Set if this should marshal to a fragment. If true an XML header string is not written out.
        Parameters:
        fragment - if this should marshal to a fragment or not
      • isFragment

        public boolean isFragment()
        PUBLIC: Returns if this should marshal to a fragment. If true an XML header string is not written out.
        Returns:
        if this should marshal to a fragment or not
      • getTransformer

        public XMLTransformer getTransformer()
        INTERNAL
        Returns:
        the transformer instance for this marshaller
      • getSchema

        public Schema getSchema()
      • setSchema

        public void setSchema(Schema schema)

EclipseLink 2.3.2, "build v20111125-r10461" API Reference