|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.cglib.beans.BeanMap
A Map
-based view of a JavaBean. The default set of keys is the
union of all property names (getters or setters). An attempt to set
a read-only property will be ignored, and write-only properties will
be returned as null
. Removal of objects is not a
supported (the key set is fixed).
Nested Class Summary | |
static class |
BeanMap.Generator
|
Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
Field Summary | |
protected java.lang.Object |
bean
|
static int |
REQUIRE_GETTER
Limit the properties reflected in the key set of the map to readable properties. |
static int |
REQUIRE_SETTER
Limit the properties reflected in the key set of the map to writable properties. |
Constructor Summary | |
protected |
BeanMap()
|
protected |
BeanMap(java.lang.Object bean)
|
Method Summary | |
void |
clear()
|
boolean |
containsKey(java.lang.Object key)
|
boolean |
containsValue(java.lang.Object value)
|
static BeanMap |
create(java.lang.Object bean)
Helper method to create a new BeanMap . |
java.util.Set |
entrySet()
|
boolean |
equals(java.lang.Object o)
|
java.lang.Object |
get(java.lang.Object key)
|
abstract java.lang.Object |
get(java.lang.Object bean,
java.lang.Object key)
Get the property of a bean. |
java.lang.Object |
getBean()
Return the bean currently in use by this map. |
abstract java.lang.Class |
getPropertyType(java.lang.String name)
Get the type of a property. |
int |
hashCode()
|
boolean |
isEmpty()
|
abstract BeanMap |
newInstance(java.lang.Object bean)
Create a new BeanMap instance using the specified bean.
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
|
abstract java.lang.Object |
put(java.lang.Object bean,
java.lang.Object key,
java.lang.Object value)
Set the property of a bean. |
void |
putAll(java.util.Map t)
|
java.lang.Object |
remove(java.lang.Object key)
|
void |
setBean(java.lang.Object bean)
Change the underlying bean this map should use. |
int |
size()
|
java.lang.String |
toString()
|
java.util.Collection |
values()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
keySet |
Field Detail |
public static final int REQUIRE_GETTER
BeanMap.Generator.setRequire(int)
,
Constant Field Valuespublic static final int REQUIRE_SETTER
BeanMap.Generator.setRequire(int)
,
Constant Field Valuesprotected java.lang.Object bean
Constructor Detail |
protected BeanMap()
protected BeanMap(java.lang.Object bean)
Method Detail |
public static BeanMap create(java.lang.Object bean)
BeanMap
. For finer
control over the generated instance, use a new instance of
BeanMap.Generator
instead of this static method.
bean
- the JavaBean underlying the map
BeanMap
instancepublic abstract BeanMap newInstance(java.lang.Object bean)
BeanMap
instance using the specified bean.
This is faster than using the create(java.lang.Object)
static method.
bean
- the JavaBean underlying the map
BeanMap
instancepublic abstract java.lang.Class getPropertyType(java.lang.String name)
name
- the name of the JavaBean property
public java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in interface java.util.Map
public abstract java.lang.Object get(java.lang.Object bean, java.lang.Object key)
BeanMap
to be used statically for multiple beans--the bean instance tied to the
map is ignored and the bean passed to this method is used instead.
bean
- the bean to query; must be compatible with the type of
this BeanMap
key
- must be a String
public abstract java.lang.Object put(java.lang.Object bean, java.lang.Object key, java.lang.Object value)
BeanMap
to be used statically for multiple beans--the bean instance tied to the
map is ignored and the bean passed to this method is used instead.
key
- must be a String
public void setBean(java.lang.Object bean)
bean
- the new JavaBeangetBean()
public java.lang.Object getBean()
setBean(java.lang.Object)
public void clear()
clear
in interface java.util.Map
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map
public int size()
size
in interface java.util.Map
public boolean isEmpty()
isEmpty
in interface java.util.Map
public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map
public void putAll(java.util.Map t)
putAll
in interface java.util.Map
public boolean equals(java.lang.Object o)
equals
in interface java.util.Map
public int hashCode()
hashCode
in interface java.util.Map
public java.util.Set entrySet()
entrySet
in interface java.util.Map
public java.util.Collection values()
values
in interface java.util.Map
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |