java.lang.Object
org.progeeks.meta.TypeRegistry
- public class TypeRegistry
- extends java.lang.Object
Class for relating objects to types. This is slightly
more involved than a simple map since some types can be
broken down further to find better values.
- Version:
- $Revision: 1.2 $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
delegate
private TypeRegistry delegate
- A registry to check when values aren't found in
this registry.
types
private java.util.Map types
- Maps property types to values.
baseTypes
private java.util.Map baseTypes
- Maps base types to values. This map is checked
when a type is not found in the types map.
TypeRegistry
public TypeRegistry()
TypeRegistry
public TypeRegistry(TypeRegistry delegate)
put
public void put(PropertyType type,
java.lang.Object value)
- Maps the value to the specified type.
putDefault
public void putDefault(java.lang.Class baseType,
java.lang.Object value)
- Maps the value with a default base type. The defaults
are checked when a specific property type is not found.
get
public java.lang.Object get(PropertyType type,
boolean searchDefaults)
- Returns the object associated with the specified type.
Search order goes: regular, delegate's regular, compatible
super-types, defaults, delegate's defaults.
get
public java.lang.Object get(PropertyType type)
getDefault
public java.lang.Object getDefault(PropertyType type)