Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

E28847-01


org.eclipse.persistence.sdo.helper.delegates
Class SDOTypeHelperDelegate

java.lang.Object
  extended by org.eclipse.persistence.sdo.helper.delegates.SDOTypeHelperDelegate

All Implemented Interfaces:
SDOTypeHelper

public class SDOTypeHelperDelegate
extends java.lang.Object
implements SDOTypeHelper

Purpose: Helper to provide access to declared SDO Types.

Responsibilities:


Field Summary
private  HelperContext aHelperContext
           
private  java.util.List anonymousTypes
          a List of Anonymous Types
private  java.util.Map commonjHashMap
          Map containing built-in types for primitive and SDO types
private  java.util.Map commonjJavaHashMap
          Map containing built-in types for Java types
private  java.util.Map<java.lang.Class,SDOType> implClassesToSDOType
          Map of impl classes -> SDOType
private  java.util.Map<java.lang.Class,SDOType> interfacesToSDOTypeHashMap
          Map of interfaces -> SDOType
private  NamespaceResolver namespaceResolver
           
private  java.util.Map openContentProperties
          a HashMap keyed on Qname of defined open content properties
private static SDOWrapperType SDO_BOOLEAN_WRAPPER
           
private static SDOWrapperType SDO_BOOLEANOBJECT_WRAPPER
           
private static SDOWrapperType SDO_BYTE_WRAPPER
           
private static SDOWrapperType SDO_BYTEOBJECT_WRAPPER
           
private static SDOWrapperType SDO_BYTES_WRAPPER
           
private static SDOWrapperType SDO_CHARACTER_WRAPPER
           
private static SDOWrapperType SDO_CHARACTEROBJECT_WRAPPER
           
private static SDOWrapperType SDO_DATE_WRAPPER
           
private static SDOWrapperType SDO_DATETIME_WRAPPER
           
private static SDOWrapperType SDO_DAY_WRAPPER
           
private static SDOWrapperType SDO_DECIMAL_WRAPPER
           
private static SDOWrapperType SDO_DOUBLE_WRAPPER
           
private static SDOWrapperType SDO_DOUBLEOBJECT_WRAPPER
           
private static SDOWrapperType SDO_DURATION_WRAPPER
           
private static SDOWrapperType SDO_FLOAT_WRAPPER
           
private static SDOWrapperType SDO_FLOATOBJECT_WRAPPER
           
private static SDOWrapperType SDO_INT_WRAPPER
           
private static SDOWrapperType SDO_INTEGER_WRAPPER
           
private static SDOWrapperType SDO_INTOBJECT_WRAPPER
           
private static SDOWrapperType SDO_LONG_WRAPPER
           
private static SDOWrapperType SDO_LONGOBJECT_WRAPPER
           
private static SDOWrapperType SDO_MONTH_WRAPPER
           
private static SDOWrapperType SDO_MONTHDAY_WRAPPER
           
private static SDOWrapperType SDO_OBJECT_WRAPPER
           
private static SDOWrapperType SDO_SHORT_WRAPPER
           
private static SDOWrapperType SDO_SHORTOBJECT_WRAPPER
           
private static SDOWrapperType SDO_STRING_WRAPPER
           
private static SDOWrapperType SDO_STRINGS_WRAPPER
           
private static SDOWrapperType SDO_TIME_WRAPPER
           
private static SDOWrapperType SDO_URI_WRAPPER
           
private static SDOWrapperType SDO_YEAR_WRAPPER
           
private static SDOWrapperType SDO_YEARMONTH_WRAPPER
           
private static SDOWrapperType SDO_YEARMONTHDAY_WRAPPER
           
private  java.util.Map sdoToXSDTypes
          a HashMap having SDO object as key and corresponding XSD Qname Object as value
private static java.util.Map sdoTypeForSimpleJavaType
          Map containing built-in types for SDO Types keyed on Java class
private  java.util.Map typesHashMap
          Map containing user defined types
private  java.util.Map<javax.xml.namespace.QName,SDOType> wrappersHashMap
          Map containing wrapper types
private  java.util.Map xsdToSDOType
          a HashMap having XSD Qname Object as Key and corresponding SDO Object as value

 

Constructor Summary
SDOTypeHelperDelegate(HelperContext aContext)
           

 

Method Summary
 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)
           
private  SDOProperty buildPropertyFromDataObject(DataObject dataObject, Type containingType, java.util.List types)
           
 Type define(DataObject dataObject)
           
 Type define(DataObject dataObject, java.util.List types)
          Define the DataObject as a Type.
 Property defineOpenContentProperty(java.lang.String uri, DataObject propertyDO)
          Define the DataObject as a Property for setting open content.
private  void defineOpenContentProperty(java.lang.String propertyUri, java.lang.String propertyName, Property property)
          INTERNAL:
private  java.lang.String generatePrefix(java.lang.String uri)
           
 java.util.List getAnonymousTypes()
           
 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(Type type)
          INTERNAL:
 NamespaceResolver getNamespaceResolver()
          INTERNAL: Return the NamespaceResolver
 java.util.Map getOpenContentProperties()
          INTERNAL: Return the Map of Open Content Properties
 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 necessary
private static java.util.Map getSDOTypeForSimpleJavaTypeMap()
          INTERNAL:
 SDOType getSDOTypeFromXSDType(javax.xml.namespace.QName aName)
          A function to access the values stored in sdoToXSDTypes HashMap
 SDOType 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 type
 java.util.Map getTypesHashMap()
          INTERNAL:
private  java.lang.Object getValueFromObject(java.lang.Object objectValue, java.util.List types)
           
 java.util.Map getWrappersHashMap()
          INTERNAL: Return the map of Wrapper objects (SDOWrapperTypes that wrap a primitive document).
 javax.xml.namespace.QName getXSDTypeFromSDOType(Type aType)
          A function to access the values stored in xsdToSDOType HashMap
private  void initCommonjHashMap()
          initializes built-in HashMap commonjHashMap.
private  void initCommonjJavaHashMap()
           
private  void initializeTypes(java.util.List types)
           
private  void initOpenProps()
           
private  void initSdoToXSDType()
          initialize the built-in HashMap sdoToXSDTypes
private static void initSDOTypeForSimpleJavaTypeMap()
           
private  void initTypesHashMap()
          initializes HashMap typesHashMap.
private  void initWrappersHashMap()
          Initializes the wrappersHashMap HashMap.
 void initWrapperTypes()
           
private  void initXsdToSDOType()
          initialize the built-in HashMap xsdToSDOTypes
private  boolean isBaseTypeBytes(Type theType)
           
 void reset()
          INTERNAL:
 void setHelperContext(HelperContext helperContext)
          INTERNAL: Set the current helperContext to be associated with this delegate
 void 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).

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

typesHashMap

private java.util.Map typesHashMap
Map containing user defined types

wrappersHashMap

private java.util.Map<javax.xml.namespace.QName,SDOType> wrappersHashMap
Map containing wrapper types

interfacesToSDOTypeHashMap

private java.util.Map<java.lang.Class,SDOType> interfacesToSDOTypeHashMap
Map of interfaces -> SDOType

implClassesToSDOType

private java.util.Map<java.lang.Class,SDOType> implClassesToSDOType
Map of impl classes -> SDOType

commonjHashMap

private final java.util.Map commonjHashMap
Map containing built-in types for primitive and SDO types

commonjJavaHashMap

private final java.util.Map commonjJavaHashMap
Map containing built-in types for Java types

sdoTypeForSimpleJavaType

private static final java.util.Map sdoTypeForSimpleJavaType
Map containing built-in types for SDO Types keyed on Java class

sdoToXSDTypes

private final java.util.Map sdoToXSDTypes
a HashMap having SDO object as key and corresponding XSD Qname Object as value

xsdToSDOType

private final java.util.Map xsdToSDOType
a HashMap having XSD Qname Object as Key and corresponding SDO Object as value

openContentProperties

private java.util.Map openContentProperties
a HashMap keyed on Qname of defined open content properties

anonymousTypes

private java.util.List anonymousTypes
a List of Anonymous Types

aHelperContext

private HelperContext aHelperContext

namespaceResolver

private NamespaceResolver namespaceResolver

SDO_BOOLEAN_WRAPPER

private static SDOWrapperType SDO_BOOLEAN_WRAPPER

SDO_BYTE_WRAPPER

private static SDOWrapperType SDO_BYTE_WRAPPER

SDO_BYTES_WRAPPER

private static SDOWrapperType SDO_BYTES_WRAPPER

SDO_CHARACTER_WRAPPER

private static SDOWrapperType SDO_CHARACTER_WRAPPER

SDO_DATE_WRAPPER

private static SDOWrapperType SDO_DATE_WRAPPER

SDO_DATETIME_WRAPPER

private static SDOWrapperType SDO_DATETIME_WRAPPER

SDO_DAY_WRAPPER

private static SDOWrapperType SDO_DAY_WRAPPER

SDO_DECIMAL_WRAPPER

private static SDOWrapperType SDO_DECIMAL_WRAPPER

SDO_DOUBLE_WRAPPER

private static SDOWrapperType SDO_DOUBLE_WRAPPER

SDO_DURATION_WRAPPER

private static SDOWrapperType SDO_DURATION_WRAPPER

SDO_FLOAT_WRAPPER

private static SDOWrapperType SDO_FLOAT_WRAPPER

SDO_INT_WRAPPER

private static SDOWrapperType SDO_INT_WRAPPER

SDO_INTEGER_WRAPPER

private static SDOWrapperType SDO_INTEGER_WRAPPER

SDO_LONG_WRAPPER

private static SDOWrapperType SDO_LONG_WRAPPER

SDO_MONTH_WRAPPER

private static SDOWrapperType SDO_MONTH_WRAPPER

SDO_MONTHDAY_WRAPPER

private static SDOWrapperType SDO_MONTHDAY_WRAPPER

SDO_OBJECT_WRAPPER

private static SDOWrapperType SDO_OBJECT_WRAPPER

SDO_SHORT_WRAPPER

private static SDOWrapperType SDO_SHORT_WRAPPER

SDO_STRING_WRAPPER

private static SDOWrapperType SDO_STRING_WRAPPER

SDO_STRINGS_WRAPPER

private static SDOWrapperType SDO_STRINGS_WRAPPER

SDO_TIME_WRAPPER

private static SDOWrapperType SDO_TIME_WRAPPER

SDO_URI_WRAPPER

private static SDOWrapperType SDO_URI_WRAPPER

SDO_YEAR_WRAPPER

private static SDOWrapperType SDO_YEAR_WRAPPER

SDO_YEARMONTH_WRAPPER

private static SDOWrapperType SDO_YEARMONTH_WRAPPER

SDO_YEARMONTHDAY_WRAPPER

private static SDOWrapperType SDO_YEARMONTHDAY_WRAPPER

SDO_BOOLEANOBJECT_WRAPPER

private static SDOWrapperType SDO_BOOLEANOBJECT_WRAPPER

SDO_BYTEOBJECT_WRAPPER

private static SDOWrapperType SDO_BYTEOBJECT_WRAPPER

SDO_CHARACTEROBJECT_WRAPPER

private static SDOWrapperType SDO_CHARACTEROBJECT_WRAPPER

SDO_DOUBLEOBJECT_WRAPPER

private static SDOWrapperType SDO_DOUBLEOBJECT_WRAPPER

SDO_FLOATOBJECT_WRAPPER

private static SDOWrapperType SDO_FLOATOBJECT_WRAPPER

SDO_INTOBJECT_WRAPPER

private static SDOWrapperType SDO_INTOBJECT_WRAPPER

SDO_LONGOBJECT_WRAPPER

private static SDOWrapperType SDO_LONGOBJECT_WRAPPER

SDO_SHORTOBJECT_WRAPPER

private static SDOWrapperType SDO_SHORTOBJECT_WRAPPER

Constructor Detail

SDOTypeHelperDelegate

public SDOTypeHelperDelegate(HelperContext aContext)

Method Detail

initWrapperTypes

public void initWrapperTypes()

addWrappersToProject

public void addWrappersToProject(Project project)
Specified by:
addWrappersToProject in interface SDOTypeHelper

initCommonjHashMap

private void initCommonjHashMap()
initializes built-in HashMap commonjHashMap.

initCommonjJavaHashMap

private void initCommonjJavaHashMap()

initTypesHashMap

private void initTypesHashMap()
initializes HashMap typesHashMap.

initWrappersHashMap

private void initWrappersHashMap()
Initializes the wrappersHashMap HashMap.

initSdoToXSDType

private void initSdoToXSDType()
initialize the built-in HashMap sdoToXSDTypes

initXsdToSDOType

private void initXsdToSDOType()
initialize the built-in HashMap xsdToSDOTypes

initSDOTypeForSimpleJavaTypeMap

private static void initSDOTypeForSimpleJavaTypeMap()

getJavaWrapperTypeForSDOType

public java.lang.Class getJavaWrapperTypeForSDOType(Type type)
Description copied from interface: SDOTypeHelper
INTERNAL:
Specified by:
getJavaWrapperTypeForSDOType in interface SDOTypeHelper
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.
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 interface SDOTypeHelper

getType

public SDOType 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.

getTypeForImplClass

public SDOType getTypeForImplClass(java.lang.Class implClass)
Specified by:
getTypeForImplClass in interface SDOTypeHelper

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 interface SDOTypeHelper
Returns:

define

public Type define(DataObject dataObject)

initializeTypes

private void initializeTypes(java.util.List types)

define

public Type define(DataObject dataObject,
                   java.util.List types)
Define the DataObject as a Type. The Type is available through TypeHelper and DataGraph getType() methods.
Parameters:
type - the DataObject representing the Type.
Returns:
the defined Type.
Throws:
java.lang.IllegalArgumentException - if the Type could not be defined.

isBaseTypeBytes

private boolean isBaseTypeBytes(Type theType)

getValueFromObject

private java.lang.Object getValueFromObject(java.lang.Object objectValue,
                                            java.util.List types)

buildPropertyFromDataObject

private SDOProperty buildPropertyFromDataObject(DataObject dataObject,
                                                Type containingType,
                                                java.util.List types)

getXSDTypeFromSDOType

public javax.xml.namespace.QName getXSDTypeFromSDOType(Type aType)
A function to access the values stored in xsdToSDOType HashMap
Specified by:
getXSDTypeFromSDOType in interface SDOTypeHelper
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 interface SDOTypeHelper
Parameters:
aName -
Returns:

setTypesHashMap

public void setTypesHashMap(java.util.Map typesHashMap)
Description copied from interface: SDOTypeHelper
INTERNAL:
Specified by:
setTypesHashMap in interface SDOTypeHelper

getTypesHashMap

public java.util.Map getTypesHashMap()
Description copied from interface: SDOTypeHelper
INTERNAL:
Specified by:
getTypesHashMap in interface SDOTypeHelper
Returns:

getWrappersHashMap

public java.util.Map getWrappersHashMap()
INTERNAL: Return the map of Wrapper objects (SDOWrapperTypes that wrap a primitive document).
Specified by:
getWrappersHashMap in interface SDOTypeHelper
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 interface SDOTypeHelper
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 interface SDOTypeHelper

defineOpenContentProperty

public Property defineOpenContentProperty(java.lang.String uri,
                                          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.
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.

defineOpenContentProperty

private void defineOpenContentProperty(java.lang.String propertyUri,
                                       java.lang.String propertyName,
                                       Property property)
INTERNAL:
Parameters:
propertyQName -
property -

getOpenContentProperty

public 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.
Parameters:
uri - the namespace URI of the open Property.
propertyName - the name of the open Property.
Returns:
the open Property.

getSDOTypeForSimpleJavaTypeMap

private static java.util.Map getSDOTypeForSimpleJavaTypeMap()
INTERNAL:
Returns:

getHelperContext

public HelperContext getHelperContext()
INTERNAL: Return the current helperContext associated with this delegate.
Specified by:
getHelperContext in interface SDOTypeHelper
Returns:

setHelperContext

public void setHelperContext(HelperContext helperContext)
INTERNAL: Set the current helperContext to be associated with this delegate
Specified by:
setHelperContext in interface SDOTypeHelper

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 interface SDOTypeHelper

generatePrefix

private java.lang.String generatePrefix(java.lang.String uri)

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 interface SDOTypeHelper

getNamespaceResolver

public NamespaceResolver getNamespaceResolver()
INTERNAL: Return the NamespaceResolver
Specified by:
getNamespaceResolver in interface SDOTypeHelper

getOpenContentProperties

public java.util.Map getOpenContentProperties()
INTERNAL: Return the Map of Open Content Properties
Specified by:
getOpenContentProperties in interface SDOTypeHelper

initOpenProps

private void initOpenProps()

getInterfacesToSDOTypeHashMap

public java.util.Map getInterfacesToSDOTypeHashMap()
Specified by:
getInterfacesToSDOTypeHashMap in interface SDOTypeHelper

getImplClassesToSDOType

public java.util.Map<java.lang.Class,SDOType> getImplClassesToSDOType()
Specified by:
getImplClassesToSDOType in interface SDOTypeHelper

getAnonymousTypes

public java.util.List getAnonymousTypes()
Specified by:
getAnonymousTypes in interface SDOTypeHelper

Skip navigation links

Copyright © 1998, 2012, Oracle. All Rights Reserved.