|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.favabeans.util.DagInheritanceProperties | +--org.favabeans.base.DefaultTypeMetadataRegistry
Constructor Summary | |
DefaultTypeMetadataRegistry()
|
Method Summary | |
void |
addTypeInfoListener(TypeInfoListener l)
|
boolean |
containsKey(Object context,
Object key)
Determine if this InheritanceProperties maps a
given key to a value in a given context, or one of its
super-contexts. |
boolean |
containsKey(Object context,
Object key,
boolean inherit)
Determine if this InheritanceProperties maps a
given key to a value in a given context. |
protected void |
fireTypeInfoChanged(Type type)
|
Object |
get(Object context,
Object key)
Return the associated value for the given key in the specified context or one of its super-contexts. |
Object |
get(Object context,
Object key,
boolean inherit)
Return the associated value for the given key in the specified context. |
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 |
getKeys(Object context)
Get the keys associated with a given context, or one of its super-contexts. |
Set |
getKeys(Object context,
boolean inherit)
Get the keys associated with a given context. |
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. |
Object |
put(Object context,
Object key,
Object value)
Create a direct association from a key to a value. |
Object |
remove(Object context,
Object key)
Remove the direct association between a key and a value in a given context. |
void |
removeTypeInfoListener(TypeInfoListener l)
|
Methods inherited from class org.favabeans.util.DagInheritanceProperties |
clear, comparator, contextPoset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.favabeans.util.InheritanceProperties |
clear, comparator, contextPoset |
Constructor Detail |
public DefaultTypeMetadataRegistry()
Method Detail |
public boolean containsKey(Object context, Object key)
InheritanceProperties
InheritanceProperties
maps a
given key to a value in a given context, or one of its
super-contexts.containsKey
in interface InheritanceProperties
containsKey
in class DagInheritanceProperties
org.favabeans.util.InheritanceProperties
context
- the context in which to resolve the key.key
- a key which may be in this
InheritanceProperties
.true
if the supplied key
is
mapped to a value in the given context or one of its
super-contexts.public boolean containsKey(Object context, Object key, boolean inherit)
InheritanceProperties
InheritanceProperties
maps a
given key to a value in a given context.containsKey
in interface InheritanceProperties
containsKey
in class DagInheritanceProperties
org.favabeans.util.InheritanceProperties
context
- the context in which to resolve the key.key
- a key which may be in this
InheritanceProperties
.inherit
- set to true
if super-contexts are
to be included in the search; false
if only the
specified context is to be searched.true
if the supplied key
is
mapped to a value in the specified context or, if applicable,
one of its super-contexts.public Object get(Object context, Object key)
InheritanceProperties
get
in interface InheritanceProperties
get
in class DagInheritanceProperties
org.favabeans.util.InheritanceProperties
context
- the context in which to resolve the key.key
- the key for which a value is required.null
if none
could be found.public Object get(Object context, Object key, boolean inherit)
InheritanceProperties
get
in interface InheritanceProperties
get
in class DagInheritanceProperties
org.favabeans.util.InheritanceProperties
context
- the context in which to resolve the key.key
- the key for which a value is required.inherit
- set to true
if super-contexts are
to be included in the search; false
if only the
specified context is to be searched.null
if none
could be found.public Object put(Object context, Object key, Object value)
InheritanceProperties
put
in interface InheritanceProperties
put
in class DagInheritanceProperties
org.favabeans.util.InheritanceProperties
context
- the context in which to associate the value with
the key.key
- the key with which to associate the value.value
- the value to associate with the supplied key.null
if none existed.public Object remove(Object context, Object key)
InheritanceProperties
remove
in interface InheritanceProperties
remove
in class DagInheritanceProperties
org.favabeans.util.InheritanceProperties
context
- the context in which to remove the association.key
- the key for which to remove the associated value.null
if no association
previously associated.public Set getKeys(Object context)
InheritanceProperties
getKeys
in interface InheritanceProperties
getKeys
in class DagInheritanceProperties
org.favabeans.util.InheritanceProperties
context
- the context for which to obtain the keys.InheritanceProperties
and has no super-contexts in
this InheritanceProperties
.public Set getKeys(Object context, boolean inherit)
InheritanceProperties
getKeys
in interface InheritanceProperties
getKeys
in class DagInheritanceProperties
org.favabeans.util.InheritanceProperties
context
- the context for which to obtain the keys.inherit
- whether to obtain keys for the super-contexts of
this context.InheritanceProperties
and,
if applicable, has no super-contexts in this
InheritanceProperties
.public Object getForObject(Object o, String key)
TypeMetadataRegistry
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.getForObject
in interface TypeMetadataRegistry
org.favabeans.base.TypeMetadataRegistry
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)
TypeMetadataRegistry
Type
s (or their super-Type
s) which
match a given object.getKeysForObject
in interface TypeMetadataRegistry
org.favabeans.base.TypeMetadataRegistry
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)
TypeMetadataRegistry
Type
s (or their
super-Type
s) which match a given object.getKeysForObject
in interface TypeMetadataRegistry
org.favabeans.base.TypeMetadataRegistry
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 l)
addTypeInfoListener
in interface TypeMetadataRegistry
public void removeTypeInfoListener(TypeInfoListener l)
removeTypeInfoListener
in interface TypeMetadataRegistry
protected void fireTypeInfoChanged(Type type)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |