|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.mmbase.datatypes.DataTypeCollector
public final class DataTypeCollector
A DataTypeCollector is a collection of named DataTypes. So, you can add and request DataType
objects from this by a String. It also facilitates 'chaining' because you can add other
DataTypeCollectors to it. It will delegate searching of a datatype to them, if a certain key is
not available.
This object also knowns how to 'lock' its DataType's using it's 'signature'. I have no idea where
that is good for.
| Field Summary | |
|---|---|
(package private) static DataTypeCollector |
systemDataTypeCollector
|
| Constructor Summary | |
|---|---|
DataTypeCollector(Serializable signature)
|
|
| Method Summary | |
|---|---|
void |
addCollector(DataTypeCollector collector)
Adds a datatype collector on which this collector depends. |
BasicDataType<?> |
addDataType(BasicDataType<?> dataType)
Adds a datatype to this collector. |
(package private) void |
clear()
|
boolean |
contains(DataType<?> dataType)
Returns whether the dataType is part of the current collection. |
boolean |
contains(String name)
Returns whether the dataType with the given name is part of the current collection. |
(package private) static DataTypeCollector |
createSystemDataTypeCollector()
Creates the DataTypeCollector used to store datatypes accessible throughout the application. |
void |
finish(DataType<?> dataType)
Lock a dataType so it can be changed or altered. |
Iterator<DataType<?>> |
getAllSpecializations(String name)
Recursively calls getSpecializations(String) so that you can easily iterate also all indirectly specializaed versions of a certain DataType in this collector |
BasicDataType<?> |
getDataType(String name)
Get a datatype defined for this collector. |
BasicDataType<?> |
getDataType(String name,
boolean recursive)
Get a datatype defined for this collector, and possibly any collectors it depends on. |
DataTypeDefinition |
getDataTypeDefinition()
|
BasicDataType<?> |
getDataTypeInstance(String name,
DataType<?> baseDataType)
Get a datatype instance through this collector. |
Map<String,BasicDataType<?>> |
getDataTypes()
Set local datatypes of the collector |
Set<DataType<?>> |
getRoots()
Returns all DataTypes in this Collector which did not have an origina DataType (in this Collector). |
Collection<DataType<?>> |
getSpecializations(String name)
Returns a set of all DataTypes in this collector which are directly inherited from the one with given name |
void |
rewrite(DataType<?> dataType)
Unlock a dataType so it can be changed or altered. |
void |
setDataTypes(Map<String,BasicDataType<?>> dataTypes)
Set local datatypes of the collector |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
static DataTypeCollector systemDataTypeCollector
| Constructor Detail |
|---|
public DataTypeCollector(Serializable signature)
signature - the object used to finish a data type for this collector.| Method Detail |
|---|
static DataTypeCollector createSystemDataTypeCollector()
DataTypes class.
public DataTypeDefinition getDataTypeDefinition()
public void addCollector(DataTypeCollector collector)
collector - the dataType collector to addpublic void setDataTypes(Map<String,BasicDataType<?>> dataTypes)
dataTypes - a Map containing the datatypespublic Map<String,BasicDataType<?>> getDataTypes()
public BasicDataType<?> getDataType(String name)
name - the name of the datatype to retrieve
DataType with the given name, as defined for this collector, or null
if no datatype is defined.public BasicDataType<?> addDataType(BasicDataType<?> dataType)
dataType - the datatype to add
null
if it is not applicable.public Collection<DataType<?>> getSpecializations(String name)
public Iterator<DataType<?>> getAllSpecializations(String name)
getSpecializations(String) so that you can easily iterate also all indirectly specializaed versions of a certain DataType in this collector
public Set<DataType<?>> getRoots()
public BasicDataType<?> getDataType(String name,
boolean recursive)
name - the name of the datatype to retrieverecursive - if true, the datatype is also searched in collectors it depends on.
DataType with the given name, as defined for this collector, or null
if no datatype is defined.
public BasicDataType<?> getDataTypeInstance(String name,
DataType<?> baseDataType)
name - the name of the datatype to retrievebaseDataType - the datatype to base a new datatype on if it is not yet defined. Can be null.
DataType with the given name, as defined for this collector, or null
if no datatype is defined and no base datatype was passed.public boolean contains(String name)
public boolean contains(DataType<?> dataType)
public void rewrite(DataType<?> dataType)
public void finish(DataType<?> dataType)
void clear()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||