|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.cglib.beans.BeanMap
public abstract class 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/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Field Summary | |
|---|---|
protected 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(Object bean)
|
| Method Summary | |
|---|---|
void |
clear()
|
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
static BeanMap |
create(Object bean)
Helper method to create a new BeanMap. |
Set |
entrySet()
|
boolean |
equals(Object o)
|
Object |
get(Object key)
|
abstract Object |
get(Object bean,
Object key)
Get the property of a bean. |
Object |
getBean()
Return the bean currently in use by this map. |
abstract Class |
getPropertyType(String name)
Get the type of a property. |
int |
hashCode()
|
boolean |
isEmpty()
|
abstract BeanMap |
newInstance(Object bean)
Create a new BeanMap instance using the specified bean. |
Object |
put(Object key,
Object value)
|
abstract Object |
put(Object bean,
Object key,
Object value)
Set the property of a bean. |
void |
putAll(Map t)
|
Object |
remove(Object key)
|
void |
setBean(Object bean)
Change the underlying bean this map should use. |
int |
size()
|
String |
toString()
|
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 Object bean
| Constructor Detail |
|---|
protected BeanMap()
protected BeanMap(Object bean)
| Method Detail |
|---|
public static BeanMap create(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(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 Class getPropertyType(String name)
name - the name of the JavaBean property
public Object get(Object key)
get in interface Map
public Object put(Object key,
Object value)
put in interface Map
public abstract Object get(Object bean,
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 BeanMapkey - must be a String
public abstract Object put(Object bean,
Object key,
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(Object bean)
bean - the new JavaBeangetBean()public Object getBean()
setBean(java.lang.Object)public void clear()
clear in interface Mappublic boolean containsKey(Object key)
containsKey in interface Mappublic boolean containsValue(Object value)
containsValue in interface Mappublic int size()
size in interface Mappublic boolean isEmpty()
isEmpty in interface Mappublic Object remove(Object key)
remove in interface Mappublic void putAll(Map t)
putAll in interface Mappublic boolean equals(Object o)
equals in interface Mapequals in class Objectpublic int hashCode()
hashCode in interface MaphashCode in class Objectpublic Set entrySet()
entrySet in interface Mappublic Collection values()
values in interface Mappublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||