Class SDOTypeHelperDelegate
- java.lang.Object
-
- org.eclipse.persistence.sdo.helper.delegates.SDOTypeHelperDelegate
-
- All Implemented Interfaces:
commonj.sdo.helper.TypeHelper
,SDOTypeHelper
public class SDOTypeHelperDelegate extends java.lang.Object implements SDOTypeHelper
Purpose: Helper to provide access to declared SDO Types.
Responsibilities:
- 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SDOTypeHelperDelegate.SDOWrapperTypeId
-
Constructor Summary
Constructors Constructor Description SDOTypeHelperDelegate(commonj.sdo.helper.HelperContext aContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
addNamespace(java.lang.String prefix, java.lang.String uri)
INTERNAL: Add the given namespace uri and prefix to the global namespace resolver.void
addType(SDOType newType)
INTERNAL:void
addWrappersToProject(Project project)
commonj.sdo.Type
define(commonj.sdo.DataObject dataObject)
commonj.sdo.Type
define(commonj.sdo.DataObject dataObject, java.util.List types)
Define the DataObject as a Type.java.util.List
define(java.util.List types)
Define the list of DataObjects as Types.commonj.sdo.Property
defineOpenContentProperty(java.lang.String uri, commonj.sdo.DataObject propertyDO)
Define the DataObject as a Property for setting open content.java.util.List
getAnonymousTypes()
commonj.sdo.helper.HelperContext
getHelperContext()
INTERNAL: Return the current helperContext associated with this delegate.java.util.Map<java.lang.Class,SDOType>
getImplClassesToSDOType()
java.util.Map
getInterfacesToSDOTypeHashMap()
java.lang.Class
getJavaWrapperTypeForSDOType(commonj.sdo.Type type)
INTERNAL:NamespaceResolver
getNamespaceResolver()
INTERNAL: Return the NamespaceResolverjava.util.Map
getOpenContentProperties()
INTERNAL: Return the Map of Open Content Propertiescommonj.sdo.Property
getOpenContentProperty(java.lang.String uri, java.lang.String propertyName)
Get the open Property with the specified uri and name, or null if not found.java.lang.String
getPrefix(java.lang.String uri)
INTERNAL: Return the prefix for the given uri, or generate a new one if necessarySDOType
getSDOTypeFromXSDType(javax.xml.namespace.QName aName)
A function to access the values stored in sdoToXSDTypes HashMapSDOType
getType(java.lang.Class interfaceClass)
Return the Type for this interfaceClass or null if not found.SDOType
getType(java.lang.String uri, java.lang.String typeName)
Return the Type specified by typeName with the given uri, or null if not found.SDOType
getTypeForImplClass(java.lang.Class implClass)
SDOType
getTypeForSimpleJavaType(java.lang.Class implClass)
INTERNAL: Used to determine which SDO Type corresponds the given Java simple typejava.util.Map
getTypesHashMap()
INTERNAL:java.util.Map
getWrappersHashMap()
INTERNAL: Return the map of Wrapper objects (SDOWrapperTypes that wrap a primitive document).javax.xml.namespace.QName
getXSDTypeFromSDOType(commonj.sdo.Type aType)
A function to access the values stored in xsdToSDOType HashMapvoid
initWrapperTypes()
void
reset()
INTERNAL:void
setHelperContext(commonj.sdo.helper.HelperContext helperContext)
INTERNAL: Set the current helperContext to be associated with this delegatevoid
setTypesHashMap(java.util.Map typesHashMap)
INTERNAL:void
setWrappersHashMap(java.util.Map aMap)
INTERNAL: Set the map of Wrapper objects (SDOWrapperTypes that wrap a primitive document).
-
-
-
Method Detail
-
initWrapperTypes
public void initWrapperTypes()
-
addWrappersToProject
public void addWrappersToProject(Project project)
- Specified by:
addWrappersToProject
in interfaceSDOTypeHelper
-
getJavaWrapperTypeForSDOType
public java.lang.Class getJavaWrapperTypeForSDOType(commonj.sdo.Type type)
Description copied from interface:SDOTypeHelper
INTERNAL:- Specified by:
getJavaWrapperTypeForSDOType
in interfaceSDOTypeHelper
- Returns:
-
getType
public SDOType getType(java.lang.String uri, java.lang.String typeName)
Return the Type specified by typeName with the given uri, or null if not found.- Specified by:
getType
in interfacecommonj.sdo.helper.TypeHelper
- 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.
-
addType
public void addType(SDOType newType)
Description copied from interface:SDOTypeHelper
INTERNAL:- Specified by:
addType
in interfaceSDOTypeHelper
-
getType
public SDOType getType(java.lang.Class interfaceClass)
Return the Type for this interfaceClass or null if not found.- Specified by:
getType
in interfacecommonj.sdo.helper.TypeHelper
- 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(java.lang.Class implClass)
- Specified by:
getTypeForImplClass
in interfaceSDOTypeHelper
-
getTypeForSimpleJavaType
public SDOType getTypeForSimpleJavaType(java.lang.Class implClass)
INTERNAL: Used to determine which SDO Type corresponds the given Java simple type- Specified by:
getTypeForSimpleJavaType
in interfaceSDOTypeHelper
- Returns:
-
define
public commonj.sdo.Type define(commonj.sdo.DataObject dataObject)
- Specified by:
define
in interfacecommonj.sdo.helper.TypeHelper
-
define
public commonj.sdo.Type define(commonj.sdo.DataObject dataObject, java.util.List types)
Define the DataObject as a Type. The Type is available through TypeHelper and DataGraph getType() methods.- Parameters:
dataObject
- the DataObject representing the Type.- Returns:
- the defined Type.
- Throws:
java.lang.IllegalArgumentException
- if the Type could not be defined.
-
define
public java.util.List define(java.util.List types)
Define the list of DataObjects as Types. The Types are available through TypeHelper and DataGraph getType() methods.- Specified by:
define
in interfacecommonj.sdo.helper.TypeHelper
- Parameters:
types
- a List of DataObjects representing the Types.- Returns:
- the defined Types.
- Throws:
java.lang.IllegalArgumentException
- if the Types could not be defined.
-
getXSDTypeFromSDOType
public javax.xml.namespace.QName getXSDTypeFromSDOType(commonj.sdo.Type aType)
A function to access the values stored in xsdToSDOType HashMap- Specified by:
getXSDTypeFromSDOType
in interfaceSDOTypeHelper
- Parameters:
aType
- a SDO Type Object- Returns:
- the corresponding XSD QName Object
-
getSDOTypeFromXSDType
public SDOType getSDOTypeFromXSDType(javax.xml.namespace.QName aName)
A function to access the values stored in sdoToXSDTypes HashMap- Specified by:
getSDOTypeFromXSDType
in interfaceSDOTypeHelper
- Parameters:
aName
-- Returns:
-
setTypesHashMap
public void setTypesHashMap(java.util.Map typesHashMap)
Description copied from interface:SDOTypeHelper
INTERNAL:- Specified by:
setTypesHashMap
in interfaceSDOTypeHelper
-
getTypesHashMap
public java.util.Map getTypesHashMap()
Description copied from interface:SDOTypeHelper
INTERNAL:- Specified by:
getTypesHashMap
in interfaceSDOTypeHelper
- Returns:
-
getWrappersHashMap
public java.util.Map 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
public void setWrappersHashMap(java.util.Map aMap)
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
public commonj.sdo.Property defineOpenContentProperty(java.lang.String uri, commonj.sdo.DataObject propertyDO)
Define the DataObject as a Property for setting open content. The new property or, if already defined, an existing property is returned. The containing Type of the open property is not specified by SDO. If the specified uri is not null the defined property is accessible through TypeHelper.getOpenProperty(uri, propertyName). If a null uri is specified, the location and management of the open property is not specified by SDO.- Specified by:
defineOpenContentProperty
in interfacecommonj.sdo.helper.TypeHelper
- Parameters:
uri
- the namespace URI of the open Property or null.- Returns:
- the defined open Property.
- Throws:
java.lang.IllegalArgumentException
- if the Property could not be defined.
-
getOpenContentProperty
public commonj.sdo.Property getOpenContentProperty(java.lang.String uri, java.lang.String propertyName)
Get the open Property with the specified uri and name, or null if not found.- Specified by:
getOpenContentProperty
in interfacecommonj.sdo.helper.TypeHelper
- Parameters:
uri
- the namespace URI of the open Property.propertyName
- the name of the open Property.- Returns:
- the open Property.
-
getHelperContext
public commonj.sdo.helper.HelperContext getHelperContext()
INTERNAL: Return the current helperContext associated with this delegate.- Specified by:
getHelperContext
in interfaceSDOTypeHelper
- Returns:
-
setHelperContext
public void setHelperContext(commonj.sdo.helper.HelperContext helperContext)
INTERNAL: Set the current helperContext to be associated with this delegate- Specified by:
setHelperContext
in interfaceSDOTypeHelper
-
getPrefix
public java.lang.String getPrefix(java.lang.String uri)
INTERNAL: Return the prefix for the given uri, or generate a new one if necessary- Specified by:
getPrefix
in interfaceSDOTypeHelper
-
addNamespace
public java.lang.String addNamespace(java.lang.String prefix, java.lang.String uri)
INTERNAL: Add the given namespace uri and prefix to the global namespace resolver.- Specified by:
addNamespace
in interfaceSDOTypeHelper
-
getNamespaceResolver
public NamespaceResolver getNamespaceResolver()
INTERNAL: Return the NamespaceResolver- Specified by:
getNamespaceResolver
in interfaceSDOTypeHelper
-
getOpenContentProperties
public java.util.Map getOpenContentProperties()
INTERNAL: Return the Map of Open Content Properties- Specified by:
getOpenContentProperties
in interfaceSDOTypeHelper
-
getInterfacesToSDOTypeHashMap
public java.util.Map getInterfacesToSDOTypeHashMap()
- Specified by:
getInterfacesToSDOTypeHashMap
in interfaceSDOTypeHelper
-
getImplClassesToSDOType
public java.util.Map<java.lang.Class,SDOType> getImplClassesToSDOType()
- Specified by:
getImplClassesToSDOType
in interfaceSDOTypeHelper
-
getAnonymousTypes
public java.util.List getAnonymousTypes()
- Specified by:
getAnonymousTypes
in interfaceSDOTypeHelper
-
-