EclipseLink 2.2.0, build 'v20110202-r8913' API Reference

org.eclipse.persistence.sdo.helper.delegates
Class SDOXMLHelperDelegate

java.lang.Object
  extended by org.eclipse.persistence.sdo.helper.delegates.SDOXMLHelperDelegate
All Implemented Interfaces:
XMLHelper, SDOXMLHelper
Direct Known Subclasses:
JAXBXMLHelper

public class SDOXMLHelperDelegate
extends java.lang.Object
implements SDOXMLHelper

Purpose: Helper to XML documents into DataObects and DataObjects into XML documents.

Responsibilities:


Field Summary
 
Fields inherited from interface commonj.sdo.helper.XMLHelper
INSTANCE
 
Constructor Summary
SDOXMLHelperDelegate(HelperContext aContext)
           
SDOXMLHelperDelegate(HelperContext aContext, java.lang.ClassLoader aClassLoader)
           
 
Method Summary
 void addDescriptors(java.util.List types)
          INTERNAL:
 XMLDocument createDocument(DataObject dataObject, java.lang.String rootElementURI, java.lang.String rootElementName)
          Creates an XMLDocument with the specified XML rootElement for the DataObject.
 HelperContext getHelperContext()
          INTERNAL: Return the helperContext that this instance is associated with.
 SDOClassLoader getLoader()
          INTERNAL:
 Project getTopLinkProject()
          INTERNAL:
 XMLContext getXmlContext()
          INTERNAL:
 org.eclipse.persistence.internal.oxm.XMLConversionManager getXmlConversionManager()
          INTERNAL:
 XMLMarshaller getXmlMarshaller()
          INTERNAL:
 XMLUnmarshaller getXmlUnmarshaller()
          INTERNAL:
 void initializeDescriptor(XMLDescriptor descriptor)
           
 XMLDocument load(org.xml.sax.InputSource inputSource, java.lang.String locationURI, java.lang.Object options)
          Creates and returns an XMLDocument from the inputSource.
 XMLDocument load(java.io.InputStream inputStream)
          Creates and returns an XMLDocument from the inputStream.
 XMLDocument load(java.io.InputStream inputStream, java.lang.String locationURI, java.lang.Object options)
          Creates and returns an XMLDocument from the inputStream.
 XMLDocument load(java.io.Reader inputReader, java.lang.String locationURI, java.lang.Object options)
          Creates and returns an XMLDocument from the inputReader.
 XMLDocument load(javax.xml.transform.Source source, java.lang.String locationURI, java.lang.Object options)
          Creates and returns an XMLDocument from the inputSource.
 XMLDocument load(java.lang.String inputString)
          Creates and returns an XMLDocument from the input String.
 void reset()
          INTERNAL:
 java.lang.String save(DataObject dataObject, java.lang.String rootElementURI, java.lang.String rootElementName)
          Returns the DataObject saved as an XML document with the specified root element.
 void save(DataObject dataObject, java.lang.String rootElementURI, java.lang.String rootElementName, java.io.OutputStream outputStream)
          Saves the DataObject as an XML document with the specified root element.
 void save(XMLDocument xmlDocument, java.io.OutputStream outputStream, java.lang.Object options)
          Serializes an XMLDocument as an XML document into the outputStream.
 void save(XMLDocument xmlDocument, javax.xml.transform.Result result, java.lang.Object options)
          Serializes an XMLDocument as an XML document into the outputResult in a serialization technology independent format (as specified in javax.xml.transform).
 void save(XMLDocument xmlDocument, java.io.Writer outputWriter, java.lang.Object options)
          Serializes an XMLDocument as an XML document into the outputWriter.
 void serialize(XMLDocument xmlDocument, java.io.OutputStream outputStream, java.lang.Object options)
           
 void setHelperContext(HelperContext helperContext)
          INTERNAL: Set the helperContext that this instance is associated with.
 void setLoader(SDOClassLoader loader)
          INTERNAL:
 void setTimeZone(java.util.TimeZone timeZone)
          The specified TimeZone will be used for all String to date object conversions.
 void setTimeZoneQualified(boolean timeZoneQualified)
          By setting this flag to true the marshalled date objects marshalled to the XML schema types time and dateTime will be qualified by a time zone.
 void setTopLinkProject(Project toplinkProject)
          INTERNAL:
 void setXmlContext(XMLContext xmlContext)
          INTERNAL:
 void setXmlMarshaller(XMLMarshaller xmlMarshaller)
          INTERNAL:
 void setXmlUnmarshaller(XMLUnmarshaller xmlUnmarshaller)
          INTERNAL:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SDOXMLHelperDelegate

public SDOXMLHelperDelegate(HelperContext aContext)

SDOXMLHelperDelegate

public SDOXMLHelperDelegate(HelperContext aContext,
                            java.lang.ClassLoader aClassLoader)
Method Detail

setTimeZone

public void setTimeZone(java.util.TimeZone timeZone)
The specified TimeZone will be used for all String to date object conversions. By default the TimeZone from the JVM is used.

Specified by:
setTimeZone in interface SDOXMLHelper

setTimeZoneQualified

public void setTimeZoneQualified(boolean timeZoneQualified)
By setting this flag to true the marshalled date objects marshalled to the XML schema types time and dateTime will be qualified by a time zone. By default time information is not time zone qualified.

Specified by:
setTimeZoneQualified in interface SDOXMLHelper

load

public XMLDocument load(java.lang.String inputString)
Creates and returns an XMLDocument from the input String. By default does not perform XSD validation. Same as load(new StringReader(inputString), null, null);

Specified by:
load in interface XMLHelper
Parameters:
inputString - specifies the String to read from
Returns:
the new XMLDocument loaded
Throws:
java.lang.RuntimeException - for errors in XML parsing or implementation-specific validation.

load

public XMLDocument load(java.io.InputStream inputStream)
                 throws java.io.IOException
Creates and returns an XMLDocument from the inputStream. The InputStream will be closed after reading. By default does not perform XSD validation. Same as load(inputStream, null, null);

Specified by:
load in interface XMLHelper
Parameters:
inputStream - specifies the InputStream to read from
Returns:
the new XMLDocument loaded
Throws:
java.io.IOException - for stream exceptions.
java.lang.RuntimeException - for errors in XML parsing or implementation-specific validation.

load

public XMLDocument load(java.io.InputStream inputStream,
                        java.lang.String locationURI,
                        java.lang.Object options)
                 throws java.io.IOException
Creates and returns an XMLDocument from the inputStream. The InputStream will be closed after reading. By default does not perform XSD validation.

Specified by:
load in interface XMLHelper
Parameters:
inputStream - specifies the InputStream to read from
locationURI - specifies the URI of the document for relative schema locations
options - implementation-specific options.
Returns:
the new XMLDocument loaded
Throws:
java.io.IOException - for stream exceptions.
java.lang.RuntimeException - for errors in XML parsing or implementation-specific validation.

load

public XMLDocument load(org.xml.sax.InputSource inputSource,
                        java.lang.String locationURI,
                        java.lang.Object options)
                 throws java.io.IOException
Creates and returns an XMLDocument from the inputSource. The InputSource will be closed after reading. By default does not perform XSD validation.

Specified by:
load in interface SDOXMLHelper
Parameters:
inputSource - specifies the InputSource to read from
locationURI - specifies the URI of the document for relative schema locations
options - implementation-specific options.
Returns:
the new XMLDocument loaded
Throws:
java.io.IOException - for stream exceptions.
java.lang.RuntimeException - for errors in XML parsing or implementation-specific validation.

load

public XMLDocument load(java.io.Reader inputReader,
                        java.lang.String locationURI,
                        java.lang.Object options)
                 throws java.io.IOException
Creates and returns an XMLDocument from the inputReader. The InputStream will be closed after reading. By default does not perform XSD validation.

Specified by:
load in interface XMLHelper
Parameters:
inputReader - specifies the Reader to read from
locationURI - specifies the URI of the document for relative schema locations
options - implementation-specific options.
Returns:
the new XMLDocument loaded
Throws:
java.io.IOException - for stream exceptions.
java.lang.RuntimeException - for errors in XML parsing or implementation-specific validation.

load

public XMLDocument load(javax.xml.transform.Source source,
                        java.lang.String locationURI,
                        java.lang.Object options)
                 throws java.io.IOException
Description copied from interface: XMLHelper
Creates and returns an XMLDocument from the inputSource. The InputSource will be closed after reading. By default does not perform XSD validation.

Specified by:
load in interface XMLHelper
Parameters:
source - specifies the Source to read from
locationURI - specifies the URI of the document for relative schema locations
options - implementation-specific options.
Returns:
the new XMLDocument loaded
Throws:
java.io.IOException - for stream exceptions.

save

public java.lang.String save(DataObject dataObject,
                             java.lang.String rootElementURI,
                             java.lang.String rootElementName)
Returns the DataObject saved as an XML document with the specified root element. Same as StringWriter stringWriter = new StringWriter(); save(createDocument(dataObject, rootElementURI, rootElementName), stringWriter, null); stringWriter.toString();

Specified by:
save in interface XMLHelper
Parameters:
dataObject - specifies DataObject to be saved
rootElementURI - the Target Namespace URI of the root XML element
rootElementName - the Name of the root XML element
Returns:
the saved XML document as a string
Throws:
java.lang.IllegalArgumentException - if the dataObject tree is not closed or has no container.

save

public void save(DataObject dataObject,
                 java.lang.String rootElementURI,
                 java.lang.String rootElementName,
                 java.io.OutputStream outputStream)
          throws XMLMarshalException,
                 java.io.IOException
Saves the DataObject as an XML document with the specified root element. Same as save(createDocument(dataObject, rootElementURI, rootElementName), outputStream, null);

Specified by:
save in interface XMLHelper
Parameters:
dataObject - specifies DataObject to be saved
rootElementURI - the Target Namespace URI of the root XML element
rootElementName - the Name of the root XML element
outputStream - specifies the OutputStream to write to.
Throws:
java.io.IOException - for stream exceptions.
java.lang.IllegalArgumentException - if the dataObject tree is not closed or has no container.
XMLMarshalException

serialize

public void serialize(XMLDocument xmlDocument,
                      java.io.OutputStream outputStream,
                      java.lang.Object options)
               throws java.io.IOException
Specified by:
serialize in interface SDOXMLHelper
Throws:
java.io.IOException

save

public void save(XMLDocument xmlDocument,
                 java.io.OutputStream outputStream,
                 java.lang.Object options)
          throws java.io.IOException
Serializes an XMLDocument as an XML document into the outputStream. If the DataObject's Type was defined by an XSD, the serialization will follow the XSD. Otherwise the serialization will follow the format as if an XSD were generated as defined by the SDO specification. The OutputStream will be flushed after writing. Does not perform validation to ensure compliance with an XSD.

Specified by:
save in interface XMLHelper
Parameters:
xmlDocument - specifies XMLDocument to be saved
outputStream - specifies the OutputStream to write to.
options - implementation-specific options.
Throws:
java.io.IOException - for stream exceptions.
java.lang.IllegalArgumentException - if the dataObject tree is not closed or has no container.

save

public void save(XMLDocument xmlDocument,
                 java.io.Writer outputWriter,
                 java.lang.Object options)
          throws java.io.IOException
Serializes an XMLDocument as an XML document into the outputWriter. If the DataObject's Type was defined by an XSD, the serialization will follow the XSD. Otherwise the serialization will follow the format as if an XSD were generated as defined by the SDO specification. The OutputStream will be flushed after writing. Does not perform validation to ensure compliance with an XSD.

Specified by:
save in interface XMLHelper
Parameters:
xmlDocument - specifies XMLDocument to be saved
outputWriter - specifies the Writer to write to.
options - implementation-specific options.
Throws:
java.io.IOException - for stream exceptions.
java.lang.IllegalArgumentException - if the dataObject tree is not closed or has no container.

save

public void save(XMLDocument xmlDocument,
                 javax.xml.transform.Result result,
                 java.lang.Object options)
          throws java.io.IOException
Description copied from interface: XMLHelper
Serializes an XMLDocument as an XML document into the outputResult in a serialization technology independent format (as specified in javax.xml.transform). The OutputResult will be flushed after writing. Does not perform validation to ensure compliance with an XSD.

Specified by:
save in interface XMLHelper
Parameters:
xmlDocument - specifies XMLDocument to be saved
result - specifies Result to be saved
options - implementation-specific options.
Throws:
java.io.IOException - for stream exceptions.

createDocument

public XMLDocument createDocument(DataObject dataObject,
                                  java.lang.String rootElementURI,
                                  java.lang.String rootElementName)
Creates an XMLDocument with the specified XML rootElement for the DataObject.

Specified by:
createDocument in interface XMLHelper
Parameters:
dataObject - specifies DataObject to be saved
rootElementURI - the Target Namespace URI of the root XML element
rootElementName - the Name of the root XML element
Returns:
XMLDocument a new XMLDocument set with the specified parameters.

setLoader

public void setLoader(SDOClassLoader loader)
Description copied from interface: SDOXMLHelper
INTERNAL:

Specified by:
setLoader in interface SDOXMLHelper

getLoader

public SDOClassLoader getLoader()
Description copied from interface: SDOXMLHelper
INTERNAL:

Specified by:
getLoader in interface SDOXMLHelper
Returns:

setXmlContext

public void setXmlContext(XMLContext xmlContext)
Description copied from interface: SDOXMLHelper
INTERNAL:

Specified by:
setXmlContext in interface SDOXMLHelper

getXmlContext

public XMLContext getXmlContext()
Description copied from interface: SDOXMLHelper
INTERNAL:

Specified by:
getXmlContext in interface SDOXMLHelper
Returns:

initializeDescriptor

public void initializeDescriptor(XMLDescriptor descriptor)
Specified by:
initializeDescriptor in interface SDOXMLHelper

addDescriptors

public void addDescriptors(java.util.List types)
Description copied from interface: SDOXMLHelper
INTERNAL:

Specified by:
addDescriptors in interface SDOXMLHelper

setTopLinkProject

public void setTopLinkProject(Project toplinkProject)
Description copied from interface: SDOXMLHelper
INTERNAL:

Specified by:
setTopLinkProject in interface SDOXMLHelper

getTopLinkProject

public Project getTopLinkProject()
Description copied from interface: SDOXMLHelper
INTERNAL:

Specified by:
getTopLinkProject in interface SDOXMLHelper
Returns:

setXmlMarshaller

public void setXmlMarshaller(XMLMarshaller xmlMarshaller)
Description copied from interface: SDOXMLHelper
INTERNAL:

Specified by:
setXmlMarshaller in interface SDOXMLHelper

getXmlMarshaller

public XMLMarshaller getXmlMarshaller()
Description copied from interface: SDOXMLHelper
INTERNAL:

Specified by:
getXmlMarshaller in interface SDOXMLHelper
Returns:

setXmlUnmarshaller

public void setXmlUnmarshaller(XMLUnmarshaller xmlUnmarshaller)
Description copied from interface: SDOXMLHelper
INTERNAL:

Specified by:
setXmlUnmarshaller in interface SDOXMLHelper

getXmlUnmarshaller

public XMLUnmarshaller getXmlUnmarshaller()
Description copied from interface: SDOXMLHelper
INTERNAL:

Specified by:
getXmlUnmarshaller in interface SDOXMLHelper
Returns:

reset

public void reset()
Description copied from interface: SDOXMLHelper
INTERNAL:

Specified by:
reset in interface SDOXMLHelper

getHelperContext

public HelperContext getHelperContext()
Description copied from interface: SDOXMLHelper
INTERNAL: Return the helperContext that this instance is associated with.

Specified by:
getHelperContext in interface SDOXMLHelper
Returns:

setHelperContext

public void setHelperContext(HelperContext helperContext)
Description copied from interface: SDOXMLHelper
INTERNAL: Set the helperContext that this instance is associated with.

Specified by:
setHelperContext in interface SDOXMLHelper

getXmlConversionManager

public org.eclipse.persistence.internal.oxm.XMLConversionManager getXmlConversionManager()
Description copied from interface: SDOXMLHelper
INTERNAL:

Specified by:
getXmlConversionManager in interface SDOXMLHelper

EclipseLink 2.2.0, build 'v20110202-r8913' API Reference