Class SDOTypeHelperDelegate

  • All Implemented Interfaces:
    TypeHelper, SDOTypeHelper

    public class SDOTypeHelperDelegate
    extends 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.
    • Constructor Detail

      • SDOTypeHelperDelegate

        public SDOTypeHelperDelegate​(HelperContext aContext)
    • Method Detail

      • initWrapperTypes

        public void initWrapperTypes()
      • getType

        public SDOType getType​(String uri,
                               String typeName)
        Return the Type specified by typeName with the given uri, or null if not found.
        Specified by:
        getType in interface 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.
      • getType

        public SDOType getType​(Class interfaceClass)
        Return the Type for this interfaceClass or null if not found.
        Specified by:
        getType in interface TypeHelper
        Parameters:
        interfaceClass - is the interface for the DataObject's Type - type.getInstanceClass();
        Returns:
        the Type for this interfaceClass or null if not found.
      • getTypeForSimpleJavaType

        public SDOType getTypeForSimpleJavaType​(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)
        Description copied from interface: TypeHelper
        Define the DataObject as a Type. The Type is available through TypeHelper.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.
        Specified by:
        define in interface TypeHelper
        Parameters:
        dataObject - the DataObject representing the Type.
        Returns:
        the defined Type.
      • define

        public Type define​(DataObject dataObject,
                           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:
        IllegalArgumentException - if the Type could not be defined.
      • define

        public List define​(List types)
        Define the list of DataObjects as Types. The Types are available through TypeHelper and DataGraph getType() methods.
        Specified by:
        define in interface TypeHelper
        Parameters:
        types - a List of DataObjects representing the Types.
        Returns:
        the defined Types.
        Throws:
        IllegalArgumentException - if the Types could not be defined.
      • getXSDTypeFromSDOType

        public 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​(QName aName)
        A function to access the values stored in sdoToXSDTypes HashMap
        Specified by:
        getSDOTypeFromXSDType in interface SDOTypeHelper
        Parameters:
        aName -
        Returns:
      • getWrappersHashMap

        public 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​(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.
      • defineOpenContentProperty

        public Property defineOpenContentProperty​(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.
        Specified by:
        defineOpenContentProperty in interface TypeHelper
        Parameters:
        uri - the namespace URI of the open Property or null.
        Returns:
        the defined open Property.
        Throws:
        IllegalArgumentException - if the Property could not be defined.
      • getOpenContentProperty

        public Property getOpenContentProperty​(String uri,
                                               String propertyName)
        Get the open Property with the specified uri and name, or null if not found.
        Specified by:
        getOpenContentProperty in interface TypeHelper
        Parameters:
        uri - the namespace URI of the open Property.
        propertyName - the name of the open Property.
        Returns:
        the open Property.
      • 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 String getPrefix​(String uri)
        INTERNAL: Return the prefix for the given uri, or generate a new one if necessary
        Specified by:
        getPrefix in interface SDOTypeHelper