EclipseLink 2.2.0, build 'v20110202-r8913' API Reference

commonj.sdo.helper
Interface TypeHelper

All Known Subinterfaces:
SDOTypeHelper
All Known Implementing Classes:
SDOTypeHelperDelegate, SDOTypeHelperDelegator

public interface TypeHelper

Look up a Type given the uri and typeName or interfaceClass. SDO Types are available through the getType("commonj.sdo", typeName) method. Defines Types from DataObjects.


Field Summary
static TypeHelper INSTANCE
          The default TypeHelper.
 
Method Summary
 Type define(DataObject type)
          Define the DataObject as a Type.
 java.util.List define(java.util.List types)
          Define the list of DataObjects as Types.
 Property defineOpenContentProperty(java.lang.String uri, DataObject property)
          Define the DataObject as a Property for setting open content.
 Property getOpenContentProperty(java.lang.String uri, java.lang.String propertyName)
          Get the open content (global) Property with the specified uri and name, or null if not found.
 Type getType(java.lang.Class interfaceClass)
          Return the Type for this interfaceClass or null if not found.
 Type getType(java.lang.String uri, java.lang.String typeName)
          Return the Type specified by typeName with the given uri, or null if not found.
 

Field Detail

INSTANCE

static final TypeHelper INSTANCE
The default TypeHelper.

Method Detail

getType

Type getType(java.lang.String uri,
             java.lang.String typeName)
Return the Type specified by typeName with the given uri, or null if not found. If the XSD uri (in the case of built-in Schema types) or the XSD typeName (in case an sdo:name annotation has been used) are different from the SDO name and uri (as returned by type.getURI()) and type.getName()), only the SDO uri and name are used for the lookup.
If null or "" is passed as the value of the uri parameter, then a type with no URI will be returned, if found.

Parameters:
uri - The uri of the Type - type.getURI();
typeName - The name of the Type - type.getName();
Returns:
the Type specified by typeName with the given uri, or null if not found.

getType

Type getType(java.lang.Class interfaceClass)
Return the Type for this interfaceClass or null if not found.

Parameters:
interfaceClass - is the interface for the DataObject's Type - type.getInstanceClass();
Returns:
the Type for this interfaceClass or null if not found.

getOpenContentProperty

Property getOpenContentProperty(java.lang.String uri,
                                java.lang.String propertyName)
Get the open content (global) Property with the specified uri and name, or null if not found. If the Schema name of the Property is different than its SDO name, only the SDO name is used for the lookup.
If null or "" is passed as the value of the uri parameter, then a Property with no URI will be returned. (for example, a property mapped from a global element in an XSD with no target namespace)

Parameters:
uri - the namespace URI of the open content Property.
propertyName - the name of the open content Property.
Returns:
the global Property.

define

Type define(DataObject type)
Define the DataObject as a Type. The Type is available through getType(java.lang.String, java.lang.String) methods. If a type with the same name already exists, it is returned and no new definition takes place. If the uri property of the type to be defined is set to "", then the resulting type will have no uri, same as if the uri property was set to null.

Parameters:
type - the DataObject representing the Type.
Returns:
the defined Type.
Throws:
java.lang.IllegalArgumentException - if the Type could not be defined.

define

java.util.List define(java.util.List types)
Define the list of DataObjects as Types. The Types are available through getType(java.lang.String, java.lang.String) methods. The output list will contain, for every item in the input list, either the Type newly defined or a pre-existing Type in case a Type with the given name already exists, followed by any other types defined as a result of this call.

Parameters:
types - a List of DataObjects representing the Types.
Returns:
the defined Types.
Throws:
java.lang.IllegalArgumentException - if the Types could not be defined.

defineOpenContentProperty

Property defineOpenContentProperty(java.lang.String uri,
                                   DataObject property)
Define the DataObject as a Property for setting open content. The containing Type of the open content property is not specified by SDO. If the specified uri is not null the defined property is accessible through TypeHelper.getOpenContentProperty(uri, propertyName). If a null uri is specified, the location and management of the open content property is not specified by SDO.

Parameters:
uri - the namespace URI of the open content Property or null.
Returns:
the defined open content Property.
Throws:
java.lang.IllegalArgumentException - if the Property could not be defined.

EclipseLink 2.2.0, build 'v20110202-r8913' API Reference