Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


oracle.javatools.db.datatypes
Class DataTypeRegistry

java.lang.Object
  extended by oracle.javatools.db.datatypes.DataTypeRegistry


public final class DataTypeRegistry
extends java.lang.Object

Registry for DataTypes. Allowed DataTypes are registered against a specific DBObjectProvider class as allowed types. Having a single registry for all providers ensures that all supported database's DataTypes are known to users of the API.

All datatype names are uppercased before being cached, and all queries to find a datatype by name are uppercased as well.


Nested Class Summary
static class DataTypeRegistry.Registerer
          A Registerer is responsible for providing allowed DataTypes for a given provider class.

 

Method Summary
 DataType createUserDataType(java.lang.String name, java.lang.Class provider)
          Used to create a "user" datatype for types that are discovered that we didn't already know about (usually from a foreign database, or for un-imported object types.
 DataType findAnsiType(java.lang.String name)
          Returns the registered ansi datatype with the given name (if one exists).
 ComplexType findComplexType(java.lang.String name, java.lang.String schemaName, java.lang.Class provider)
          Returns a ComplexType with given name from a schema registered against the given provider class.
 DataType findDataType(java.lang.String name, java.lang.Class provider)
          Returns the DataType regsitered with a given name against the (provider class, and all superclasses)
 DataType[] getAnsiTypes()
          Returns the ansi types that are registered.
 DataType getBaseType(DataType synonym)
          Returns the base DataType for this synonym DataType, or null if the given DataType isn't a synonym.
static DataTypeRegistry getInstance()
          Returns the global instance of the DataTypeRegistry.
 DataType getMappedAnsiType(DataType type)
          Returns the ANSI DataType (if there is one) that this DataType maps to.
 DataType getMappedType(java.lang.String ansiTypeName, java.lang.Class provider)
          Returns a provider's DataType that maps to an ANSI data type name, or null if there isn't one.
static boolean isGenericJdbcClass(java.lang.Class clz)
           
 boolean isRegisteredType(DataType type)
          Returns true if the given type is registered with this registry.
 boolean isSynonymType(DataType type)
          Returns true if the given type is a synonym for another type.
 ComplexType[] listComplexTypes(java.lang.String schemaName, java.lang.Class provider)
          Returns all the ComplexTypes registered under the given schema name for the registered provider Class and its superclasses.
 java.lang.String[] listComplexTypeSchemas(java.lang.Class provider)
           
 DataType[] listDataTypes(java.lang.Class provider)
          Returns the registered DataType instances for a given provider class (and all superclasses)
 void mapToAnsiType(DataType type, DataType ansiType)
          Maps a DataType for a Database to an ANSI type.
 void mapToAnsiType(DataType type, java.lang.String ansiTypeName)
          Maps a DataType for a Database to an ANSI type.
 void registerComplexType(ComplexType type, java.lang.Class provider)
          Register a complex type against a given schema.
 void registerDataType(DataType type, java.lang.Class provider)
          Registers a DataType against the given provider class.
 void registerDataType(DataType type, java.lang.Class provider, DataType ansiType)
          Registers a DataType against the given provider class and includes the ANSI equivalent of this type.
static void registerGenericJdbcClass(java.lang.Class<? extends JdbcDatabase> clz)
           
 void registerProvider(DataTypeRegistry.Registerer reg, java.lang.Class provider)
          Registers a provider of datatypes against
 void registerSynonym(DataType synonymType, DataType baseType, java.lang.Class provider)
          Registers a DataType as a synonym for the given base DataType in the given provider.
 DataType registerSynonym(java.lang.String synonym, DataType baseType, java.lang.Class provider)
          Registers a new synonym for the given DataType in the given provider.

 

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

 

Method Detail

registerProvider

public void registerProvider(DataTypeRegistry.Registerer reg,
                             java.lang.Class provider)
Registers a provider of datatypes against

registerDataType

public void registerDataType(DataType type,
                             java.lang.Class provider)
Registers a DataType against the given provider class.

registerDataType

public void registerDataType(DataType type,
                             java.lang.Class provider,
                             DataType ansiType)
Registers a DataType against the given provider class and includes the ANSI equivalent of this type.

registerComplexType

public void registerComplexType(ComplexType type,
                                java.lang.Class provider)
Register a complex type against a given schema.

createUserDataType

public DataType createUserDataType(java.lang.String name,
                                   java.lang.Class provider)
Used to create a "user" datatype for types that are discovered that we didn't already know about (usually from a foreign database, or for un-imported object types.

findDataType

public DataType findDataType(java.lang.String name,
                             java.lang.Class provider)
Returns the DataType regsitered with a given name against the (provider class, and all superclasses)

findComplexType

public ComplexType findComplexType(java.lang.String name,
                                   java.lang.String schemaName,
                                   java.lang.Class provider)
Returns a ComplexType with given name from a schema registered against the given provider class. If no type is found null is returned.

listDataTypes

public DataType[] listDataTypes(java.lang.Class provider)
Returns the registered DataType instances for a given provider class (and all superclasses)

listComplexTypes

public ComplexType[] listComplexTypes(java.lang.String schemaName,
                                      java.lang.Class provider)
Returns all the ComplexTypes registered under the given schema name for the registered provider Class and its superclasses.

listComplexTypeSchemas

public java.lang.String[] listComplexTypeSchemas(java.lang.Class provider)

isRegisteredType

public boolean isRegisteredType(DataType type)
Returns true if the given type is registered with this registry. Useful to identify built-in or user defined types.

registerSynonym

public DataType registerSynonym(java.lang.String synonym,
                                DataType baseType,
                                java.lang.Class provider)
Registers a new synonym for the given DataType in the given provider. The synonym DataType will have exactly the same attributes and behaviour as the underlying type and just have a different name.

registerSynonym

public void registerSynonym(DataType synonymType,
                            DataType baseType,
                            java.lang.Class provider)
Registers a DataType as a synonym for the given base DataType in the given provider.

isSynonymType

public boolean isSynonymType(DataType type)
Returns true if the given type is a synonym for another type.

getBaseType

public DataType getBaseType(DataType synonym)
Returns the base DataType for this synonym DataType, or null if the given DataType isn't a synonym.

findAnsiType

public DataType findAnsiType(java.lang.String name)
Returns the registered ansi datatype with the given name (if one exists).

getAnsiTypes

public DataType[] getAnsiTypes()
Returns the ansi types that are registered.

mapToAnsiType

public void mapToAnsiType(DataType type,
                          java.lang.String ansiTypeName)
Maps a DataType for a Database to an ANSI type. An assert will fail if the ansi type being mapped to isn't registered.

mapToAnsiType

public void mapToAnsiType(DataType type,
                          DataType ansiType)
Maps a DataType for a Database to an ANSI type. An assert will fail if the ansi type being mapped to isn't registered.

getMappedAnsiType

public DataType getMappedAnsiType(DataType type)
Returns the ANSI DataType (if there is one) that this DataType maps to.

getMappedType

public DataType getMappedType(java.lang.String ansiTypeName,
                              java.lang.Class provider)
Returns a provider's DataType that maps to an ANSI data type name, or null if there isn't one.

getInstance

public static DataTypeRegistry getInstance()
Returns the global instance of the DataTypeRegistry.

registerGenericJdbcClass

public static final void registerGenericJdbcClass(java.lang.Class<? extends JdbcDatabase> clz)

isGenericJdbcClass

public static final boolean isGenericJdbcClass(java.lang.Class clz)

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


Copyright © 1997, 2011, Oracle. All rights reserved.