com.bea.wli.datatype
Class DataTypeRegistry

java.lang.Object
  extended by com.bea.wli.datatype.DataTypeRegistry

public class DataTypeRegistry
extends Object

Maintains a list of registered data types. Any number of DataTypeRegistries may exist in a single Java Virtual Machine.


Constructor Summary
DataTypeRegistry(DataTypeRegistry parent)
          Construct a new DataTypeRegistry instance based on the given parent registry.
 
Method Summary
 DataType deregisterDataType(DataType dataType)
          Remove the given DataType instance from this registry.
 DataTypeEditor deregisterDataTypeEditor(String key, DataTypeEditor editor)
           
 DataType getDataType(String id)
          Get the DataType instance with the given id from this registry (or its ancestors).
 DataType getDataType(String id, String serializedVariantInfo, ClassLoader loader)
          Get the DataType instance with the given id from this registry (or its ancestors) and create a new variant of the base data type using the provided serializedVariantInfo.
<T extends DataTypeEditor>
T
getDataTypeEditor(String key, Class<T> editorClass)
           
static DataTypeRegistry getDefaultRegistry()
          Get the default DataTypeRegistry containing the built-in data types.
static Class getEditorClass(DataTypeEditor editor)
           
 Map<String,DataType> getRegisteredDataTypeMap()
           
 boolean hasDataType(String id)
          Search this registry (and its ancestors) looking for a data type with the given id.
 boolean hasDataTypeEditor(String key)
           
 boolean hasDataTypeEditor(String key, Class editorClass)
           
 DataType registerDataType(DataType dataType, boolean replaceExisting)
          Register a new DataType implementation into this registry.
 DataTypeEditor registerDataTypeEditor(String key, DataTypeEditor editor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataTypeRegistry

public DataTypeRegistry(DataTypeRegistry parent)
                 throws DataTypeException
Construct a new DataTypeRegistry instance based on the given parent registry. All DataTypeRegistry instances must be based on a registry that descends from the registry returned by getDefaultRegistry(). The new registry will have access to all the data types contained in the parent registry.

Parameters:
parent -
Throws:
DataTypeException
Method Detail

getDefaultRegistry

public static DataTypeRegistry getDefaultRegistry()
Get the default DataTypeRegistry containing the built-in data types.

Returns:

registerDataType

public DataType registerDataType(DataType dataType,
                                 boolean replaceExisting)
                          throws DataTypeException
Register a new DataType implementation into this registry.

Parameters:
dataType -
replaceExisting -
Returns:
Throws:
DataTypeException

deregisterDataType

public DataType deregisterDataType(DataType dataType)
                            throws DataTypeException
Remove the given DataType instance from this registry. Note that you cannot deregister data types from the default registry.

Parameters:
dataType -
Returns:
Throws:
DataTypeException

hasDataType

public boolean hasDataType(String id)
Search this registry (and its ancestors) looking for a data type with the given id.

Parameters:
id -
Returns:

getDataType

public DataType getDataType(String id)
                     throws DataTypeException
Get the DataType instance with the given id from this registry (or its ancestors).

Parameters:
id -
Returns:
Throws:
DataTypeException

getDataType

public DataType getDataType(String id,
                            String serializedVariantInfo,
                            ClassLoader loader)
                     throws DataTypeException
Get the DataType instance with the given id from this registry (or its ancestors) and create a new variant of the base data type using the provided serializedVariantInfo.

Parameters:
id -
serializedVariantInfo - Variant information obtained from a prior call to DataTypeVariantInfoSerializer.serializeVariantInfo()
Returns:
Throws:
DataTypeException
See Also:
DataTypeVariantInfoSerializer.serializeVariantInfo(Object)

getRegisteredDataTypeMap

public Map<String,DataType> getRegisteredDataTypeMap()

registerDataTypeEditor

public DataTypeEditor registerDataTypeEditor(String key,
                                             DataTypeEditor editor)

getEditorClass

public static Class getEditorClass(DataTypeEditor editor)

deregisterDataTypeEditor

public DataTypeEditor deregisterDataTypeEditor(String key,
                                               DataTypeEditor editor)

hasDataTypeEditor

public boolean hasDataTypeEditor(String key)

hasDataTypeEditor

public boolean hasDataTypeEditor(String key,
                                 Class editorClass)

getDataTypeEditor

public <T extends DataTypeEditor> T getDataTypeEditor(String key,
                                                      Class<T> editorClass)
                                           throws DataTypeException
Throws:
DataTypeException