public class SDOHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM Copyright notice field.
|
static java.lang.String |
SDO_LOAD_PROPERTY_PREFIX
The property key prefix found in SDO.properties that indicate a property to include when
converting an XML document into the appropriate data object.
|
static java.lang.String |
SDO_PROPERTY_FILE
The name of the property file that will be loaded during class initialization which contains
the default save and load properties.
|
static java.lang.String |
SDO_SAVE_PROPERTY_PREFIX
The property key prefix found in SDO.properties that indicates a property to include when
saving the data object into an XML document.
|
Modifier and Type | Method and Description |
---|---|
static commonj.sdo.DataObject |
clone(commonj.sdo.DataObject dataObject)
This method returns a clone of the specified data object.
|
static commonj.sdo.DataObject |
clone(commonj.sdo.DataObject dataObject,
boolean bContainer)
This method returns a clone of the specified data object.
|
static commonj.sdo.DataObject |
convertByteArrayToDataObject(byte[] data)
This is a utility method that converts a XML document into the appropriate
SDO object. |
static byte[] |
convertDataObjectToByteArray(commonj.sdo.DataObject dataObject)
This is a utility method to convert a
SDO object into a byte array. |
static byte[] |
convertDataObjectToByteArray(commonj.sdo.DataObject dataObject,
boolean extractContainer)
This is a utility method to convert a
SDO object into a byte array. |
static org.w3c.dom.Document |
convertDataObjectToDocument(commonj.sdo.DataObject dataObject)
This is a utility method to convert a
SDO object into a Document . |
static javax.xml.soap.SOAPElement |
convertDataObjectToSOAPElement(commonj.sdo.DataObject dataObject)
This is a utility method to convert a
SDO object into a SOAPElement object. |
static commonj.sdo.DataObject |
convertElementToDataObject(org.w3c.dom.Element element)
This is a utility method that converts a
Element object into the appropriate SDO object. |
static java.lang.Object |
convertEmfXmlByteArrayToObject(byte[] convertDataObjectToByteArray)
convertEmfXmlByteArrayToObject
|
static commonj.sdo.DataObject |
convertInputStreamToDataObject(java.io.InputStream inputStream)
This is a utility method that converts a XML document into the appropriate
SDO object. |
static commonj.sdo.DataObject |
convertInputStreamToDataObject(java.io.InputStream inputStream,
boolean extractContainer)
This is a utility method that converts a XML document into the appropriate
SDO object. |
static byte[] |
convertObjectToEmfXmlByteArray(java.lang.Object objectToConvert)
convertObjectToEmfXmlByteArray
|
static commonj.sdo.DataObject |
convertSOAPElementToDataObject(javax.xml.soap.SOAPElement soapElement)
This is a utility method that converts a
SOAPElement object into the appropriate SDO object. |
static void |
move(commonj.sdo.DataObject srcObj,
commonj.sdo.DataObject descObj)
This method will move all common properties from the source to the destination object.
|
static javax.xml.datatype.XMLGregorianCalendar |
resolveDateTimeValue(java.lang.Object aDateTimeObject)
This method converts a given input object to
XMLGregorianCalendar type provided
it is of type String formatted as a lexical representation of an
xml schema dateTime data type (http://www.w3.org/TR/xmlschema-2/#dateTime). |
static java.lang.String |
toString(commonj.sdo.DataObject dataObject)
This method will return the string representation of the data object for debugging purposes.
|
static java.lang.String |
toString(commonj.sdo.DataObject dataObject,
boolean extractContainer)
This method will return the string representation of the data object for debugging purposes.
|
public static final java.lang.String COPYRIGHT
public static final java.lang.String SDO_SAVE_PROPERTY_PREFIX
public static final java.lang.String SDO_LOAD_PROPERTY_PREFIX
public static final java.lang.String SDO_PROPERTY_FILE
public static final byte[] convertDataObjectToByteArray(commonj.sdo.DataObject dataObject) throws java.io.IOException
SDO
object into a byte array. The
produced byte array is the XML representation of the SDO
object.dataObject
- The SDO
object to convert into the XML byte array.SDO
object.java.io.IOException
- There was a problem converting the SDO
object into the byte array.public static byte[] convertDataObjectToByteArray(commonj.sdo.DataObject dataObject, boolean extractContainer) throws java.io.IOException
SDO
object into a byte array. The
produced byte array is the XML representation of the SDO
object.dataObject
- The SDO
object to convert into the XML byte array.extractContainer
- Option to extract the container from the data object before serialization.SDO
object.java.io.IOException
- There was a problem converting the SDO
object into the byte array.public static final commonj.sdo.DataObject convertByteArrayToDataObject(byte[] data) throws java.io.IOException
SDO
object.
The method utilizes the package classes that have been registered to determine the appropriate
static SDO
objects the represents the elements contained in the specified XML document.data
- A byte array that contains the XML document to convert.SDO
object that represents the XML document specified.java.io.IOException
- There was a problem converting the byte array into the SDO
object.public static final commonj.sdo.DataObject convertInputStreamToDataObject(java.io.InputStream inputStream) throws java.io.IOException
SDO
object.
The method utilizes the package classes that have been registered to determine the appropriate
static SDO
objects the represents the elements contained in the specified XML document.inputStream
- An input stream that contains the XML document to convert.SDO
object that represents the XML document specified.java.io.IOException
- There was a problem converting the byte array into the SDO
object.public static commonj.sdo.DataObject convertInputStreamToDataObject(java.io.InputStream inputStream, boolean extractContainer) throws java.io.IOException
SDO
object.
The method utilizes the package classes that have been registered to determine the appropriate
static SDO
objects the represents the elements contained in the specified XML document.inputStream
- An input stream that contains the XML document to convert.extractContainer
- Option to extract the first resource in the container of the result.SDO
object that represents the XML document specified.java.io.IOException
- There was a problem converting the byte array into the SDO
object.public static final javax.xml.soap.SOAPElement convertDataObjectToSOAPElement(commonj.sdo.DataObject dataObject) throws java.io.IOException, javax.xml.soap.SOAPException
SDO
object into a SOAPElement
object.dataObject
- The SDO
object to convert into SOAPElement
object.SOAPElement
object that represents the specified SDO
object.java.io.IOException
- There was a problem retieveing data from the SDO
object.javax.xml.soap.SOAPException
- There was a problem constructing the SOAPElement
object.public static final org.w3c.dom.Document convertDataObjectToDocument(commonj.sdo.DataObject dataObject) throws java.io.IOException
SDO
object into a Document
.dataObject
- The SDO
object to convert into SOAPElement
object.SDO
.java.io.IOException
- There was a problem constructing the Document
object.public static final commonj.sdo.DataObject convertElementToDataObject(org.w3c.dom.Element element) throws java.io.IOException
Element
object into the appropriate SDO
object.
The method utilizes the package classes that have been registered to determine the appropriate
static SDO
objects the represents the elements contained in the specified SOAPElement
object.element
- An element that contains the business info in SDO
.SDO
object that represents the element specified.java.io.IOException
- There was a problem converting the element into the SDO
object.public static final commonj.sdo.DataObject convertSOAPElementToDataObject(javax.xml.soap.SOAPElement soapElement) throws java.io.IOException
SOAPElement
object into the appropriate SDO
object.
The method utilizes the package classes that have been registered to determine the appropriate
static SDO
objects the represents the elements contained in the specified SOAPElement
object.soapElement
- An SOAP Element that contains the business info in SDO
.SDO
object that represents the SOAP Element specified.java.io.IOException
- There was a problem converting the SOAP element into the SDO
object.public static commonj.sdo.DataObject clone(commonj.sdo.DataObject dataObject)
dataObject
- The data object to clone.public static commonj.sdo.DataObject clone(commonj.sdo.DataObject dataObject, boolean bContainer)
dataObject
- The data object to clonebContainer
- true to clone any containers of the data object, false to only clone the data object.public static void move(commonj.sdo.DataObject srcObj, commonj.sdo.DataObject descObj)
srcObj
- The source data object.descObj
- The destination data object.public static java.lang.String toString(commonj.sdo.DataObject dataObject)
dataObject
- The data object to convert to a string.public static java.lang.String toString(commonj.sdo.DataObject dataObject, boolean extractContainer)
dataObject
- The data object to convert to a string.extractContainer
- Option to extract the container from the data object before serialization.public static javax.xml.datatype.XMLGregorianCalendar resolveDateTimeValue(java.lang.Object aDateTimeObject)
XMLGregorianCalendar
type provided
it is of type String formatted as a lexical representation of an
xml schema dateTime
data type (http://www.w3.org/TR/xmlschema-2/#dateTime).
If input parameter is of internal type org.eclipse.emf.ecore.xml.type.internal.XMLCalendar
it will be cast to XMLGregorianCalendar
.aDateTimeObject
- - an object representing the xml schema dateTime datatype
XMLGregorianCalendar
if input parameter is of type String or org.eclipse.emf.ecore.xml.type.internal.XMLCalendar.public static java.lang.Object convertEmfXmlByteArrayToObject(byte[] convertDataObjectToByteArray) throws java.io.IOException
convertDataObjectToByteArray
- The byte array to convert.java.io.IOException
- If anything goes wrong during the decoding.public static byte[] convertObjectToEmfXmlByteArray(java.lang.Object objectToConvert) throws java.io.IOException
objectToConvert
- the object to convert.java.io.IOException
- If anything goes wrong during the encoding.