public final class DataTypeRegistry
extends java.lang.Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
DataTypeRegistry.Registerer
A Registerer is responsible for providing allowed DataTypes for a given provider class.
|
Modifier and Type | Method and Description |
---|---|
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).
|
Type |
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 |
isRegisteredAttribute(java.lang.String attrName)
Tests whether the given attribute name exists on any registered datatype in the registry.
|
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.
|
Type[] |
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)
Deprecated.
use registerComplexType( Type type, Class provider )
|
void |
registerComplexType(Type 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)
Deprecated.
|
static void |
registerGenericJdbcClass(java.lang.String clzName) |
void |
registerProvider(DataTypeRegistry.Registerer reg, java.lang.Class provider)
Registers a class responsible for registering all datatypes for the given provider class.
|
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.
|
public void registerProvider(DataTypeRegistry.Registerer reg, java.lang.Class provider)
public void registerDataType(DataType type, java.lang.Class provider)
public void registerDataType(DataType type, java.lang.Class provider, DataType ansiType)
public void registerComplexType(Type type, java.lang.Class provider)
@Deprecated public void registerComplexType(ComplexType type, java.lang.Class provider)
public DataType createUserDataType(java.lang.String name, java.lang.Class provider)
public DataType findDataType(java.lang.String name, java.lang.Class provider)
public Type findComplexType(java.lang.String name, java.lang.String schemaName, java.lang.Class provider)
public DataType[] listDataTypes(java.lang.Class provider)
public Type[] listComplexTypes(java.lang.String schemaName, java.lang.Class provider)
public java.lang.String[] listComplexTypeSchemas(java.lang.Class provider)
public boolean isRegisteredType(DataType type)
public boolean isRegisteredAttribute(java.lang.String attrName)
attrName
- the name to lookuppublic DataType registerSynonym(java.lang.String synonym, DataType baseType, java.lang.Class provider)
public void registerSynonym(DataType synonymType, DataType baseType, java.lang.Class provider)
public boolean isSynonymType(DataType type)
public DataType getBaseType(DataType synonym)
public DataType findAnsiType(java.lang.String name)
public DataType[] getAnsiTypes()
public void mapToAnsiType(DataType type, java.lang.String ansiTypeName)
public void mapToAnsiType(DataType type, DataType ansiType)
public DataType getMappedAnsiType(DataType type)
public DataType getMappedType(java.lang.String ansiTypeName, java.lang.Class provider)
public static DataTypeRegistry getInstance()
public static final void registerGenericJdbcClass(java.lang.String clzName)
@Deprecated public static final void registerGenericJdbcClass(java.lang.Class<? extends JdbcDatabase> clz)
public static final boolean isGenericJdbcClass(java.lang.Class clz)