EclipseLink 2.2.0, build 'v20110202-r8913' API Reference

org.eclipse.persistence.sdo
Class SDOHelper

java.lang.Object
  extended by org.eclipse.persistence.sdo.SDOHelper

public class SDOHelper
extends java.lang.Object

This class provides a mechanism to obtain the EclipseLink implementation of various SDO runtime classes based on a given SDO class/interface. This is useful for accessing extended EclipseLink features. Using this helper class will alleviate the need for consumers of EclipseLink SDO to perform casts where their code makes use of the standard SDO API. In addition, a given SDO class/interface can be unwrapped based on a user-specified class. This will allow access - in certain cases - to a given SDO implementation class' underlying class(es). For example, an XMLHelper could be unwrapped resulting in an EclipseLink SDOXMLHelper or its underlying XMLContext.


Constructor Summary
SDOHelper()
           
 
Method Summary
static SDOChangeSummary getChangeSummary(ChangeSummary changeSummary)
          Return the EclipseLink implementation of ChangeSummary.
static SDOCopyHelper getCopyHelper(CopyHelper copyHelper)
          Return the EclipseLink implementation of CopyHelper.
static SDODataFactory getDataFactory(DataFactory dataFactory)
          Return the EclipseLink implementation of DataFactory.
static SDODataHelper getDataHelper(DataHelper dataHelper)
          Return the EclipseLink implementation of DataHelper.
static SDODataObject getDataObject(DataObject dataObject)
          Return the EclipseLink implementation of DataObject.
static SDOEqualityHelper getEqualityHelper(EqualityHelper equalityHelper)
          Return the EclipseLink implementation of EqualityHelper.
static SDOHelperContext getHelperContext(HelperContext helperContext)
          Return the EclipseLink implementation of HelperContext.
static SDOProperty getProperty(Property property)
          Return the EclipseLink implementation of Property.
static SDOSequence getSequence(Sequence sequence)
          Return the EclipseLink implementation of Sequence.
static SDOType getType(Type type)
          Return the EclipseLink implementation of Type.
static SDOTypeHelper getTypeHelper(TypeHelper typeHelper)
          Return the EclipseLink implementation of TypeHelper.
static SDOXMLHelper getXMLHelper(XMLHelper xmlHelper)
          Return the EclipseLink implementation of XMLHelper.
static SDOXSDHelper getXSDHelper(XSDHelper xsdHelper)
          Return the EclipseLink implementation of XSDHelper.
static
<T> T
unwrap(ChangeSummary changeSummary, java.lang.Class<T> clazz)
          Unwraps a given ChangeSummary resulting in an EclipseLink SDOChangeSummary.
static
<T> T
unwrap(CopyHelper copyHelper, java.lang.Class<T> clazz)
          Unwraps a given CopyHelper resulting in an EclipseLink SDOCopyHelper.
static
<T> T
unwrap(DataFactory dataFactory, java.lang.Class<T> clazz)
          Unwraps a given DataFactory resulting in an EclipseLink SDODataFactory.
static
<T> T
unwrap(DataHelper dataHelper, java.lang.Class<T> clazz)
          Unwraps a given DataHelper resulting in an EclipseLink SDODataHelper.
static
<T> T
unwrap(DataObject dataObject, java.lang.Class<T> clazz)
          Unwraps a given DataObject resulting in an EclipseLink SDODataObject.
static
<T> T
unwrap(EqualityHelper equalityHelper, java.lang.Class<T> clazz)
          Unwraps a given EqualityHelper resulting in an EclipseLink SDOEqualityHelper.
static
<T> T
unwrap(HelperContext helperContext, java.lang.Class<T> clazz)
          Unwraps a given HelperContext resulting in an EclipseLink SDOHelperContext.
static
<T> T
unwrap(Property property, java.lang.Class<T> clazz)
          Unwraps a given Property resulting in an EclipseLink SDOProperty.
static
<T> T
unwrap(Sequence sequence, java.lang.Class<T> clazz)
          Unwraps a given Sequence resulting in an EclipseLink SDOSequence.
static
<T> T
unwrap(Type type, java.lang.Class<T> clazz)
          Unwraps a given Type resulting in an EclipseLink SDOType.
static
<T> T
unwrap(TypeHelper typeHelper, java.lang.Class<T> clazz)
          Unwraps a given TypeHelper resulting in an EclipseLink SDOTypeHelper.
static
<T> T
unwrap(XMLHelper xmlHelper, java.lang.Class<T> clazz)
          Unwraps a given XMLHelper resulting in an EclipseLink SDOXMLHelper or an EclipseLink XMLContext depending on clazz.
static
<T> T
unwrap(XSDHelper xsdHelper, java.lang.Class<T> clazz)
          Unwraps a given XSDHelper resulting in an EclipseLink SDOXSDHelper.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SDOHelper

public SDOHelper()
Method Detail

getType

public static SDOType getType(Type type)
                       throws java.lang.IllegalArgumentException
Return the EclipseLink implementation of Type. The given Type is assumed to be an instance of SDOType. If not, an exception will be thrown.

Parameters:
type -
Returns:
Throws:
java.lang.IllegalArgumentException

getProperty

public static SDOProperty getProperty(Property property)
                               throws java.lang.IllegalArgumentException
Return the EclipseLink implementation of Property. The given Property is assumed to be an instance of SDOProperty. If not, an exception will be thrown.

Parameters:
property -
Returns:
Throws:
java.lang.IllegalArgumentException

getDataObject

public static SDODataObject getDataObject(DataObject dataObject)
                                   throws java.lang.IllegalArgumentException
Return the EclipseLink implementation of DataObject. The given DataObject is assumed to be an instance of SDODataObject. If not, an exception will be thrown.

Parameters:
dataObject -
Returns:
Throws:
java.lang.IllegalArgumentException

getChangeSummary

public static SDOChangeSummary getChangeSummary(ChangeSummary changeSummary)
                                         throws java.lang.IllegalArgumentException
Return the EclipseLink implementation of ChangeSummary. The given ChangeSummary is assumed to be an instance of SDOChangeSummary. If not, an exception will be thrown.

Parameters:
changeSummary -
Returns:
Throws:
java.lang.IllegalArgumentException

getSequence

public static SDOSequence getSequence(Sequence sequence)
                               throws java.lang.IllegalArgumentException
Return the EclipseLink implementation of Sequence. The given Sequence is assumed to be an instance of SDOSequence. If not, an exception will be thrown.

Parameters:
sequence -
Returns:
Throws:
java.lang.IllegalArgumentException

getHelperContext

public static SDOHelperContext getHelperContext(HelperContext helperContext)
                                         throws java.lang.IllegalArgumentException
Return the EclipseLink implementation of HelperContext. If the given HelperContext is an instance of the DefaultContext, an SDOHelperContext will be obtained via SDOHelperContext.getHelperContext(). Otherwise, the given HelperContext is assumed to be an instance of SDOHelperContext. If not, an exception will be thrown.

Parameters:
helperContext -
Returns:
Throws:
java.lang.IllegalArgumentException

getCopyHelper

public static SDOCopyHelper getCopyHelper(CopyHelper copyHelper)
                                   throws java.lang.IllegalArgumentException
Return the EclipseLink implementation of CopyHelper. The given CopyHelper is assumed to be an instance of SDOCopyHelper. If not, an exception will be thrown.

Parameters:
copyHelper -
Returns:
Throws:
java.lang.IllegalArgumentException

getDataFactory

public static SDODataFactory getDataFactory(DataFactory dataFactory)
                                     throws java.lang.IllegalArgumentException
Return the EclipseLink implementation of DataFactory. The given DataFactory is assumed to be an instance of SDODataFactory. If not, an exception will be thrown.

Parameters:
dataFactory -
Returns:
Throws:
java.lang.IllegalArgumentException

getDataHelper

public static SDODataHelper getDataHelper(DataHelper dataHelper)
                                   throws java.lang.IllegalArgumentException
Return the EclipseLink implementation of DataHelper. The given DataHelper is assumed to be an instance of SDODataHelper. If not, an exception will be thrown.

Parameters:
dataHelper -
Returns:
Throws:
java.lang.IllegalArgumentException

getEqualityHelper

public static SDOEqualityHelper getEqualityHelper(EqualityHelper equalityHelper)
                                           throws java.lang.IllegalArgumentException
Return the EclipseLink implementation of EqualityHelper. The given EqualityHelper is assumed to be an instance of SDOEqualityHelper. If not, an exception will be thrown.

Parameters:
equalityHelper -
Returns:
Throws:
java.lang.IllegalArgumentException

getTypeHelper

public static SDOTypeHelper getTypeHelper(TypeHelper typeHelper)
                                   throws java.lang.IllegalArgumentException
Return the EclipseLink implementation of TypeHelper. The given TypeHelper is assumed to be an instance of SDOTypeHelper. If not, an exception will be thrown.

Parameters:
typeHelper -
Returns:
Throws:
java.lang.IllegalArgumentException

getXMLHelper

public static SDOXMLHelper getXMLHelper(XMLHelper xmlHelper)
                                 throws java.lang.IllegalArgumentException
Return the EclipseLink implementation of XMLHelper. The given XMLHelper is assumed to be an instance of SDOXMLHelper. If not, an exception will be thrown.

Parameters:
xmlHelper -
Returns:
Throws:
java.lang.IllegalArgumentException

getXSDHelper

public static SDOXSDHelper getXSDHelper(XSDHelper xsdHelper)
                                 throws java.lang.IllegalArgumentException
Return the EclipseLink implementation of XSDHelper. The given XSDHelper is assumed to be an instance of SDOXSDHelper. If not, an exception will be thrown.

Parameters:
xsdHelper -
Returns:
Throws:
java.lang.IllegalArgumentException

unwrap

public static <T> T unwrap(Type type,
                           java.lang.Class<T> clazz)
                throws java.lang.IllegalArgumentException
Unwraps a given Type resulting in an EclipseLink SDOType. Assumes that the given Type is an instance of EclipseLink SDOType, and clazz is one of: org.eclipse.persistence.sdo.SDOType, org.eclipse.persistence.sdo.type.SDOTypeType, org.eclipse.persistence.sdo.type.SDOPropertyType, org.eclipse.persistence.sdo.type.SDOChangeSummaryType, org.eclipse.persistence.sdo.type.SDODataObjectType, org.eclipse.persistence.sdo.type.SDODataType, org.eclipse.persistence.sdo.type.SDOOpenSequencedType, org.eclipse.persistence.sdo.type.SDOObjectType, org.eclipse.persistence.sdo.type.SDOWrapperType, org.eclipse.persistence.sdo.type.SDOXMLHelperLoadOptionsType

Type Parameters:
T -
Parameters:
type -
clazz -
Returns:
Throws:
java.lang.IllegalArgumentException

unwrap

public static <T> T unwrap(Property property,
                           java.lang.Class<T> clazz)
                throws java.lang.IllegalArgumentException
Unwraps a given Property resulting in an EclipseLink SDOProperty. Assumes that the given Property is an instance of EclipseLink SDOProperty, and clazz is org.eclipse.persistence.sdo.SDOProperty.

Type Parameters:
T -
Parameters:
property -
clazz -
Returns:
Throws:
java.lang.IllegalArgumentException

unwrap

public static <T> T unwrap(DataObject dataObject,
                           java.lang.Class<T> clazz)
                throws java.lang.IllegalArgumentException
Unwraps a given DataObject resulting in an EclipseLink SDODataObject. Assumes that the given DataObject is an instance of EclipseLink SDODataObject, and clazz is org.eclipse.persistence.sdo.SDODataObject.

Type Parameters:
T -
Parameters:
dataObject -
clazz -
Returns:
Throws:
java.lang.IllegalArgumentException

unwrap

public static <T> T unwrap(ChangeSummary changeSummary,
                           java.lang.Class<T> clazz)
                throws java.lang.IllegalArgumentException
Unwraps a given ChangeSummary resulting in an EclipseLink SDOChangeSummary. Assumes that the given ChangeSummary is an instance of EclipseLink SDOChangeSummary, and clazz is org.eclipse.persistence.sdo.SDOChangeSummary.

Type Parameters:
T -
Parameters:
changeSummary -
clazz -
Returns:
Throws:
java.lang.IllegalArgumentException

unwrap

public static <T> T unwrap(Sequence sequence,
                           java.lang.Class<T> clazz)
                throws java.lang.IllegalArgumentException
Unwraps a given Sequence resulting in an EclipseLink SDOSequence. Assumes that the given Sequence is an instance of EclipseLink SDOSequence, and clazz is org.eclipse.persistence.sdo.SDOSequence.

Type Parameters:
T -
Parameters:
sequence -
clazz -
Returns:
Throws:
java.lang.IllegalArgumentException

unwrap

public static <T> T unwrap(HelperContext helperContext,
                           java.lang.Class<T> clazz)
                throws java.lang.IllegalArgumentException
Unwraps a given HelperContext resulting in an EclipseLink SDOHelperContext. Assumes that the given HelperContext is an instance of EclipseLink SDOHelperContext, and clazz is org.eclipse.persistence.sdo.helper.SDOHelperContext.

Type Parameters:
T -
Parameters:
helperContext -
clazz -
Returns:
Throws:
java.lang.IllegalArgumentException

unwrap

public static <T> T unwrap(CopyHelper copyHelper,
                           java.lang.Class<T> clazz)
                throws java.lang.IllegalArgumentException
Unwraps a given CopyHelper resulting in an EclipseLink SDOCopyHelper. Assumes that the given CopyHelper is an instance of EclipseLink SDOCopyHelper, and clazz is org.eclipse.persistence.sdo.helper.SDOCopyHelper.

Type Parameters:
T -
Parameters:
copyHelper -
clazz -
Returns:
Throws:
java.lang.IllegalArgumentException

unwrap

public static <T> T unwrap(DataFactory dataFactory,
                           java.lang.Class<T> clazz)
                throws java.lang.IllegalArgumentException
Unwraps a given DataFactory resulting in an EclipseLink SDODataFactory. Assumes that the given DataFactory is an instance of EclipseLink SDODataFactory, and clazz is org.eclipse.persistence.sdo.helper.SDODataFactory.

Type Parameters:
T -
Parameters:
dataFactory -
clazz -
Returns:
Throws:
java.lang.IllegalArgumentException

unwrap

public static <T> T unwrap(DataHelper dataHelper,
                           java.lang.Class<T> clazz)
                throws java.lang.IllegalArgumentException
Unwraps a given DataHelper resulting in an EclipseLink SDODataHelper. Assumes that the given DataHelper is an instance of EclipseLink SDODataHelper, and clazz is org.eclipse.persistence.sdo.helper.SDODataHelper.

Type Parameters:
T -
Parameters:
dataHelper -
clazz -
Returns:
Throws:
java.lang.IllegalArgumentException

unwrap

public static <T> T unwrap(EqualityHelper equalityHelper,
                           java.lang.Class<T> clazz)
                throws java.lang.IllegalArgumentException
Unwraps a given EqualityHelper resulting in an EclipseLink SDOEqualityHelper. Assumes that the given EqualityHelper is an instance of EclipseLink SDOEqualityHelper, and clazz is org.eclipse.persistence.sdo.helper.SDOEqualityHelper.

Type Parameters:
T -
Parameters:
equalityHelper -
clazz -
Returns:
Throws:
java.lang.IllegalArgumentException

unwrap

public static <T> T unwrap(TypeHelper typeHelper,
                           java.lang.Class<T> clazz)
                throws java.lang.IllegalArgumentException
Unwraps a given TypeHelper resulting in an EclipseLink SDOTypeHelper. Assumes that the given TypeHelper is an instance of EclipseLink SDOTypeHelper, and clazz is org.eclipse.persistence.sdo.helper.SDOTypeHelper.

Type Parameters:
T -
Parameters:
typeHelper -
clazz -
Returns:
Throws:
java.lang.IllegalArgumentException

unwrap

public static <T> T unwrap(XMLHelper xmlHelper,
                           java.lang.Class<T> clazz)
                throws java.lang.IllegalArgumentException
Unwraps a given XMLHelper resulting in an EclipseLink SDOXMLHelper or an EclipseLink XMLContext depending on clazz. Assumes that the given XMLHelper is an instance of EclipseLink SDOXMLHelper, and clazz is one of org.eclipse.persistence.sdo.helper.SDOXMLHelper, or org.eclipse.persistence.oxm.XMLContext. If not, an exception will be thrown.

Type Parameters:
T -
Parameters:
xmlHelper -
clazz -
Returns:
Throws:
java.lang.IllegalArgumentException

unwrap

public static <T> T unwrap(XSDHelper xsdHelper,
                           java.lang.Class<T> clazz)
                throws java.lang.IllegalArgumentException
Unwraps a given XSDHelper resulting in an EclipseLink SDOXSDHelper. Assumes that the given XSDHelper is an instance of EclipseLink SDOXSDHelper, and clazz is org.eclipse.persistence.sdo.helper.SDOXSDHelper.

Type Parameters:
T -
Parameters:
xsdHelper -
clazz -
Returns:
Throws:
java.lang.IllegalArgumentException

EclipseLink 2.2.0, build 'v20110202-r8913' API Reference