Module org.eclipse.persistence.sdo
Class SDOTypeHelperDelegator
java.lang.Object
org.eclipse.persistence.sdo.helper.delegates.AbstractHelperDelegator
org.eclipse.persistence.sdo.helper.delegates.SDOTypeHelperDelegator
- All Implemented Interfaces:
TypeHelper
,SDOTypeHelper
Purpose: Helper to provide access to declared SDO Types.
Responsibilities:
- Finds the appropriate SDOTypeHelperDelegate for the classLoader/application name and delegates work to that
- 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
Fields inherited from class org.eclipse.persistence.sdo.helper.delegates.AbstractHelperDelegator
aHelperContext
Fields inherited from interface commonj.sdo.helper.TypeHelper
INSTANCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddNamespace
(String prefix, String uri) INTERNAL: Add the given namespace uri and prefix to the global namespace resolver.void
INTERNAL:void
addWrappersToProject
(Project toplinkProject) define
(DataObject dataObject) Define the DataObject as a Type.Define the list of DataObjects as Types.defineOpenContentProperty
(String uri, DataObject property) Define the DataObject as a Property for setting open content.Class
<?> getJavaWrapperTypeForSDOType
(Type sdoType) INTERNAL:INTERNAL: Return the NamespaceResolverINTERNAL: Return the Map of Open Content PropertiesgetOpenContentProperty
(String uri, String propertyName) Get the open content (global) Property with the specified uri and name, or null if not found.INTERNAL: Return the prefix for the given uri, or generate a new one if necessarygetSDOTypeFromXSDType
(QName aName) INTERNAL:Return the Type for this interfaceClass or null if not found.Return the Type specified by typeName with the given uri, or null if not found.getTypeForImplClass
(Class<?> implClass) getTypeForSimpleJavaType
(Class<?> implClass) INTERNAL:INTERNAL:INTERNAL: Return the map of Wrapper objects (SDOWrapperTypes that wrap a primitive document).getXSDTypeFromSDOType
(Type aType) INTERNAL:void
reset()
INTERNAL:void
setTypesHashMap
(Map typesHashMap) INTERNAL:void
setWrappersHashMap
(Map aMap) INTERNAL: Set the map of Wrapper objects (SDOWrapperTypes that wrap a primitive document).Methods inherited from class org.eclipse.persistence.sdo.helper.delegates.AbstractHelperDelegator
getHelperContext, setHelperContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.persistence.sdo.helper.SDOTypeHelper
getHelperContext, setHelperContext
-
Constructor Details
-
SDOTypeHelperDelegator
public SDOTypeHelperDelegator() -
SDOTypeHelperDelegator
-
-
Method Details
-
getJavaWrapperTypeForSDOType
Description copied from interface:SDOTypeHelper
INTERNAL:- Specified by:
getJavaWrapperTypeForSDOType
in interfaceSDOTypeHelper
- Parameters:
sdoType
-- Returns:
-
getType
Description copied from interface:TypeHelper
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.
Ifnull
or""
is passed as the value of theuri
parameter, then a type with no URI will be returned, if found.- Specified by:
getType
in interfaceTypeHelper
- 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.
-
getTypeForSimpleJavaType
Description copied from interface:SDOTypeHelper
INTERNAL:- Specified by:
getTypeForSimpleJavaType
in interfaceSDOTypeHelper
- Parameters:
implClass
-- Returns:
-
addType
Description copied from interface:SDOTypeHelper
INTERNAL:- Specified by:
addType
in interfaceSDOTypeHelper
- Parameters:
newType
-
-
getType
Description copied from interface:TypeHelper
Return the Type for this interfaceClass or null if not found.- Specified by:
getType
in interfaceTypeHelper
- Parameters:
interfaceClass
- is the interface for the DataObject's Type - type.getInstanceClass();- Returns:
- the Type for this interfaceClass or null if not found.
-
getTypeForImplClass
- Specified by:
getTypeForImplClass
in interfaceSDOTypeHelper
-
define
Description copied from interface:TypeHelper
Define the DataObject as a Type. The Type is available throughTypeHelper.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 theuri
property of the type to be defined is set to""
, then the resulting type will have no uri, same as if theuri
property was set tonull
.- Specified by:
define
in interfaceTypeHelper
- Parameters:
dataObject
- the DataObject representing the Type.- Returns:
- the defined Type.
-
define
Description copied from interface:TypeHelper
Define the list of DataObjects as Types. The Types are available throughTypeHelper.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.- Specified by:
define
in interfaceTypeHelper
- Parameters:
types
- a List of DataObjects representing the Types.- Returns:
- the defined Types.
-
getXSDTypeFromSDOType
Description copied from interface:SDOTypeHelper
INTERNAL:- Specified by:
getXSDTypeFromSDOType
in interfaceSDOTypeHelper
- Parameters:
aType
-- Returns:
-
getSDOTypeFromXSDType
Description copied from interface:SDOTypeHelper
INTERNAL:- Specified by:
getSDOTypeFromXSDType
in interfaceSDOTypeHelper
- Parameters:
aName
-- Returns:
-
setTypesHashMap
Description copied from interface:SDOTypeHelper
INTERNAL:- Specified by:
setTypesHashMap
in interfaceSDOTypeHelper
- Parameters:
typesHashMap
-
-
getTypesHashMap
Description copied from interface:SDOTypeHelper
INTERNAL:- Specified by:
getTypesHashMap
in interfaceSDOTypeHelper
- Returns:
-
getWrappersHashMap
INTERNAL: Return the map of Wrapper objects (SDOWrapperTypes that wrap a primitive document).- Specified by:
getWrappersHashMap
in interfaceSDOTypeHelper
- Returns:
- a HashMap of SDOWrapperTypes, keyed on the XSD type that it wraps.
-
setWrappersHashMap
INTERNAL: Set the map of Wrapper objects (SDOWrapperTypes that wrap a primitive document).- Specified by:
setWrappersHashMap
in interfaceSDOTypeHelper
- Parameters:
aMap
- a HashMap of SDOWrapperTypes, keyed on the XSD type that it wraps.
-
reset
public void reset()Description copied from interface:SDOTypeHelper
INTERNAL:- Specified by:
reset
in interfaceSDOTypeHelper
-
defineOpenContentProperty
Description copied from interface:TypeHelper
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.- Specified by:
defineOpenContentProperty
in interfaceTypeHelper
- Parameters:
uri
- the namespace URI of the open content Property or null.- Returns:
- the defined open content Property.
-
getOpenContentProperty
Description copied from interface:TypeHelper
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.
Ifnull
or""
is passed as the value of theuri
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)- Specified by:
getOpenContentProperty
in interfaceTypeHelper
- Parameters:
uri
- the namespace URI of the open content Property.propertyName
- the name of the open content Property.- Returns:
- the global Property.
-
getTypeHelperDelegate
-
addNamespace
INTERNAL: Add the given namespace uri and prefix to the global namespace resolver.- Specified by:
addNamespace
in interfaceSDOTypeHelper
-
getPrefix
INTERNAL: Return the prefix for the given uri, or generate a new one if necessary- Specified by:
getPrefix
in interfaceSDOTypeHelper
-
getNamespaceResolver
INTERNAL: Return the NamespaceResolver- Specified by:
getNamespaceResolver
in interfaceSDOTypeHelper
-
getOpenContentProperties
INTERNAL: Return the Map of Open Content Properties- Specified by:
getOpenContentProperties
in interfaceSDOTypeHelper
-
addWrappersToProject
- Specified by:
addWrappersToProject
in interfaceSDOTypeHelper
-
getInterfacesToSDOTypeHashMap
- Specified by:
getInterfacesToSDOTypeHashMap
in interfaceSDOTypeHelper
-
getImplClassesToSDOType
- Specified by:
getImplClassesToSDOType
in interfaceSDOTypeHelper
-
getAnonymousTypes
- Specified by:
getAnonymousTypes
in interfaceSDOTypeHelper
-