|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpivot.beans.BeanDictionary
public class BeanDictionary
Exposes Java bean properties of an object via the Dictionary
interface. A call to Dictionary.get(Object)
invokes the getter for
the corresponding property, and a call to
Dictionary.put(Object, Object)
invokes the property's setter.
Properties may provide multiple setters; the appropriate setter to invoke is determined by the type of the value being set. If the value is null, the return type of the getter method is used.
Field Summary | |
---|---|
static java.lang.String |
GET_PREFIX
|
static java.lang.String |
IS_PREFIX
|
static java.lang.String |
LISTENERS_SUFFIX
|
static java.lang.String |
SET_PREFIX
|
Constructor Summary | |
---|---|
BeanDictionary(java.lang.Object bean)
Creates a new bean dictionary. |
|
BeanDictionary(java.lang.Object bean,
boolean ignoreReadOnlyProperties)
Creates a new bean dictionary. |
Method Summary | |
---|---|
boolean |
containsKey(java.lang.String key)
Verifies the existence of a property. |
java.lang.Object |
get(java.lang.String key)
Invokes the getter method for the given property. |
java.lang.Object |
getBean()
Returns the bean object this dictionary wraps. |
java.lang.Class<?> |
getType(java.lang.String key)
Returns the type of a property. |
boolean |
isEmpty()
Verifies that the bean contains at least one property. |
boolean |
isReadOnly(java.lang.String key)
Tests the read-only state of a property. |
java.util.Iterator<java.lang.String> |
iterator()
Returns an iterator over the bean's properties. |
java.lang.Object |
put(java.lang.String key,
java.lang.Object value)
Invokes the a setter method for the given property. |
java.lang.Object |
remove(java.lang.String key)
Removes a key/value pair from the map. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String GET_PREFIX
public static final java.lang.String IS_PREFIX
public static final java.lang.String SET_PREFIX
public static final java.lang.String LISTENERS_SUFFIX
Constructor Detail |
---|
public BeanDictionary(java.lang.Object bean)
bean
- The bean object to wrap.public BeanDictionary(java.lang.Object bean, boolean ignoreReadOnlyProperties)
bean
- The bean object to wrap.Method Detail |
---|
public java.lang.Object getBean()
public java.lang.Object get(java.lang.String key)
get
in interface Dictionary<java.lang.String,java.lang.Object>
key
- The property name.
public java.lang.Object put(java.lang.String key, java.lang.Object value)
put
in interface Dictionary<java.lang.String,java.lang.Object>
key
- The property name.value
- The new property value.
PropertyNotFoundException
- If the given property does not exist or is read-only.public java.lang.Object remove(java.lang.String key)
Dictionary
remove
in interface Dictionary<java.lang.String,java.lang.Object>
key
- The key whose mapping is to be removed.
java.lang.UnsupportedOperationException
- This method is not supported.public boolean containsKey(java.lang.String key)
containsKey
in interface Dictionary<java.lang.String,java.lang.Object>
key
- The property name.
public boolean isEmpty()
isEmpty
in interface Dictionary<java.lang.String,java.lang.Object>
public boolean isReadOnly(java.lang.String key)
key
- The property name.
public java.lang.Class<?> getType(java.lang.String key)
key
- The property name.
public java.util.Iterator<java.lang.String> iterator()
iterator
in interface java.lang.Iterable<java.lang.String>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |