|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A TypeMetadataRegistry
is an object that maps Type
s to associated metadata using a String
key. It is a
specialization of InheritanceProperties
with the following differences:
1. Classes of arguments. A
TypeMetadataRegistry
only accepts contexts of class
Type
and keys of class String
, and will
throw a java.lang.ClassCastException
if these requirements
are not met.
2. TypeAttribute
evaluation. When a
TypeAttribute
object is added as a value mapped to a key,
the results of its TypeAttribute.evaluate(TypeMetadataRegistry,Type,String,Object)
method is returned as the result of the getForObject(Object,String)
method.
TypeAttribute
Method Summary | |
void |
addTypeInfoListener(TypeInfoListener til)
|
Object |
getForObject(Object o,
String key)
Obtain the value mapped via a given key to the best matching Type (or one of its super-Type s) for
a given object. |
Set |
getKeysForObject(Object o)
Obtain all the keys for which values are mapped to all the Type s (or their super-Type s) which
match a given object. |
Set |
getKeysForObject(Object o,
String prefix)
Obtain all the keys, starting with a given prefix string, for which values are mapped to all the Type s (or their
super-Type s) which match a given object. |
void |
removeTypeInfoListener(TypeInfoListener til)
|
Methods inherited from interface org.favabeans.util.InheritanceProperties |
clear, comparator, containsKey, containsKey, contextPoset, get, get, getKeys, getKeys, put, remove |
Method Detail |
public Object getForObject(Object o, String key)
Type
(or one of its super-Type
s) for
a given object. If the mapped value is a TypeAttribute
,
its TypeAttribute.evaluate(TypeMetadataRegistry,Type,String,Object)
method is called, and the result returned.o
- the object for which to obtain the value.key
- the key for which to obtain the value.null
if none was
found or TypeAttribute.evaluate(TypeMetadataRegistry,Type,String,Object)
returned null
.public Set getKeysForObject(Object o)
Type
s (or their super-Type
s) which
match a given object.o
- the object for which to obtain the keys.Set
containing the keys, or an empty
Set
if none were found.public Set getKeysForObject(Object o, String prefix)
Type
s (or their
super-Type
s) which match a given object.o
- the object for which to obtain the keys.prefix
- a string with which all returned keys must start.Set
containing the keys, or an empty
Set
if none were found.String.startsWith(java.lang.String)
public void addTypeInfoListener(TypeInfoListener til)
public void removeTypeInfoListener(TypeInfoListener til)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |