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
public class SDOTypeHelperDelegator extends AbstractHelperDelegator implements 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
Constructors Constructor Description SDOTypeHelperDelegator()SDOTypeHelperDelegator(HelperContext aContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringaddNamespace(String prefix, String uri)INTERNAL: Add the given namespace uri and prefix to the global namespace resolver.voidaddType(SDOType newType)INTERNAL:voidaddWrappersToProject(org.eclipse.persistence.sessions.Project toplinkProject)Typedefine(DataObject dataObject)Define the DataObject as a Type.Listdefine(List types)Define the list of DataObjects as Types.PropertydefineOpenContentProperty(String uri, DataObject property)Define the DataObject as a Property for setting open content.ListgetAnonymousTypes()Map<Class<?>,SDOType>getImplClassesToSDOType()MapgetInterfacesToSDOTypeHashMap()Class<?>getJavaWrapperTypeForSDOType(Type sdoType)INTERNAL:org.eclipse.persistence.oxm.NamespaceResolvergetNamespaceResolver()INTERNAL: Return the NamespaceResolverMapgetOpenContentProperties()INTERNAL: Return the Map of Open Content PropertiesPropertygetOpenContentProperty(String uri, String propertyName)Get the open content (global) Property with the specified uri and name, or null if not found.StringgetPrefix(String uri)INTERNAL: Return the prefix for the given uri, or generate a new one if necessarySDOTypegetSDOTypeFromXSDType(QName aName)INTERNAL:TypegetType(Class interfaceClass)Return the Type for this interfaceClass or null if not found.TypegetType(String uri, String typeName)Return the Type specified by typeName with the given uri, or null if not found.SDOTypegetTypeForImplClass(Class<?> implClass)TypegetTypeForSimpleJavaType(Class<?> implClass)INTERNAL:SDOTypeHelperDelegategetTypeHelperDelegate()MapgetTypesHashMap()INTERNAL:MapgetWrappersHashMap()INTERNAL: Return the map of Wrapper objects (SDOWrapperTypes that wrap a primitive document).QNamegetXSDTypeFromSDOType(Type aType)INTERNAL:voidreset()INTERNAL:voidsetTypesHashMap(Map typesHashMap)INTERNAL:voidsetWrappersHashMap(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 Detail
-
SDOTypeHelperDelegator
public SDOTypeHelperDelegator()
-
SDOTypeHelperDelegator
public SDOTypeHelperDelegator(HelperContext aContext)
-
-
Method Detail
-
getJavaWrapperTypeForSDOType
public Class<?> getJavaWrapperTypeForSDOType(Type sdoType)
Description copied from interface:SDOTypeHelperINTERNAL:- Specified by:
getJavaWrapperTypeForSDOTypein interfaceSDOTypeHelper- Returns:
-
getType
public Type getType(String uri, String typeName)
Description copied from interface:TypeHelperReturn 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.
Ifnullor""is passed as the value of theuriparameter, then a type with no URI will be returned, if found.- Specified by:
getTypein 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
public Type getTypeForSimpleJavaType(Class<?> implClass)
Description copied from interface:SDOTypeHelperINTERNAL:- Specified by:
getTypeForSimpleJavaTypein interfaceSDOTypeHelper- Returns:
-
addType
public void addType(SDOType newType)
Description copied from interface:SDOTypeHelperINTERNAL:- Specified by:
addTypein interfaceSDOTypeHelper
-
getType
public Type getType(Class interfaceClass)
Description copied from interface:TypeHelperReturn the Type for this interfaceClass or null if not found.- Specified by:
getTypein 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
public SDOType getTypeForImplClass(Class<?> implClass)
- Specified by:
getTypeForImplClassin interfaceSDOTypeHelper
-
define
public Type define(DataObject dataObject)
Description copied from interface:TypeHelperDefine 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 theuriproperty of the type to be defined is set to"", then the resulting type will have no uri, same as if theuriproperty was set tonull.- Specified by:
definein interfaceTypeHelper- Parameters:
dataObject- the DataObject representing the Type.- Returns:
- the defined Type.
-
define
public List define(List types)
Description copied from interface:TypeHelperDefine 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:
definein interfaceTypeHelper- Parameters:
types- a List of DataObjects representing the Types.- Returns:
- the defined Types.
-
getXSDTypeFromSDOType
public QName getXSDTypeFromSDOType(Type aType)
Description copied from interface:SDOTypeHelperINTERNAL:- Specified by:
getXSDTypeFromSDOTypein interfaceSDOTypeHelper- Returns:
-
getSDOTypeFromXSDType
public SDOType getSDOTypeFromXSDType(QName aName)
Description copied from interface:SDOTypeHelperINTERNAL:- Specified by:
getSDOTypeFromXSDTypein interfaceSDOTypeHelper- Returns:
-
setTypesHashMap
public void setTypesHashMap(Map typesHashMap)
Description copied from interface:SDOTypeHelperINTERNAL:- Specified by:
setTypesHashMapin interfaceSDOTypeHelper
-
getTypesHashMap
public Map getTypesHashMap()
Description copied from interface:SDOTypeHelperINTERNAL:- Specified by:
getTypesHashMapin interfaceSDOTypeHelper- Returns:
-
getWrappersHashMap
public Map getWrappersHashMap()
INTERNAL: Return the map of Wrapper objects (SDOWrapperTypes that wrap a primitive document).- Specified by:
getWrappersHashMapin interfaceSDOTypeHelper- Returns:
- a HashMap of SDOWrapperTypes, keyed on the XSD type that it wraps.
-
setWrappersHashMap
public void setWrappersHashMap(Map aMap)
INTERNAL: Set the map of Wrapper objects (SDOWrapperTypes that wrap a primitive document).- Specified by:
setWrappersHashMapin interfaceSDOTypeHelper- Parameters:
aMap- a HashMap of SDOWrapperTypes, keyed on the XSD type that it wraps.
-
reset
public void reset()
Description copied from interface:SDOTypeHelperINTERNAL:- Specified by:
resetin interfaceSDOTypeHelper
-
defineOpenContentProperty
public Property defineOpenContentProperty(String uri, DataObject property)
Description copied from interface:TypeHelperDefine 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:
defineOpenContentPropertyin interfaceTypeHelper- Parameters:
uri- the namespace URI of the open content Property or null.- Returns:
- the defined open content Property.
-
getOpenContentProperty
public Property getOpenContentProperty(String uri, String propertyName)
Description copied from interface:TypeHelperGet 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.
Ifnullor""is passed as the value of theuriparameter, 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:
getOpenContentPropertyin interfaceTypeHelper- Parameters:
uri- the namespace URI of the open content Property.propertyName- the name of the open content Property.- Returns:
- the global Property.
-
getTypeHelperDelegate
public SDOTypeHelperDelegate getTypeHelperDelegate()
-
addNamespace
public String addNamespace(String prefix, String uri)
INTERNAL: Add the given namespace uri and prefix to the global namespace resolver.- Specified by:
addNamespacein interfaceSDOTypeHelper
-
getPrefix
public String getPrefix(String uri)
INTERNAL: Return the prefix for the given uri, or generate a new one if necessary- Specified by:
getPrefixin interfaceSDOTypeHelper
-
getNamespaceResolver
public org.eclipse.persistence.oxm.NamespaceResolver getNamespaceResolver()
INTERNAL: Return the NamespaceResolver- Specified by:
getNamespaceResolverin interfaceSDOTypeHelper
-
getOpenContentProperties
public Map getOpenContentProperties()
INTERNAL: Return the Map of Open Content Properties- Specified by:
getOpenContentPropertiesin interfaceSDOTypeHelper
-
addWrappersToProject
public void addWrappersToProject(org.eclipse.persistence.sessions.Project toplinkProject)
- Specified by:
addWrappersToProjectin interfaceSDOTypeHelper
-
getInterfacesToSDOTypeHashMap
public Map getInterfacesToSDOTypeHashMap()
- Specified by:
getInterfacesToSDOTypeHashMapin interfaceSDOTypeHelper
-
getImplClassesToSDOType
public Map<Class<?>,SDOType> getImplClassesToSDOType()
- Specified by:
getImplClassesToSDOTypein interfaceSDOTypeHelper
-
getAnonymousTypes
public List getAnonymousTypes()
- Specified by:
getAnonymousTypesin interfaceSDOTypeHelper
-
-