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).
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| protected Object | |
| public static final int | REQUIRE_GETTER
Limit the properties reflected in the key set of the map to readable properties. |
| public static final int | REQUIRE_SETTER
Limit the properties reflected in the key set of the map to writable properties. |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | clear()
Implements java. |
| public boolean | containsKey(Object
key whose presence in this map is to be tested key)Implements java. true if this map contains a mapping for the specified
key.
|
| public boolean | containsValue(Object
value whose presence in this map is to be tested value)Implements java. true if this map maps one or more keys to the
specified value.
|
| public static BeanMap | |
| public Set | entrySet()
Implements java. Set view of the mappings contained in this map.
|
| public boolean | equals(Object
object to be compared for equality with this map o)Overrides java. Implements java. |
| public Object | get(Object
the key whose associated value is to be returned key)Implements java. null if this map contains no mapping for the key.
|
| public abstract Object | |
| public Object | |
| public abstract Class | Returns: the type of the property, or null if the property does not existthe name of the JavaBean property name)Get the type of a property. |
| public int | hashCode()
Overrides java. Implements java. |
| public boolean | |
| public abstract BeanMap | Returns: a newBeanMap instancethe JavaBean underlying the map bean)Create a new |
| public Object | put(Object
key with which the specified value is to be associated key, Object value to be associated with the specified key value)Implements java. |
| public abstract Object | |
| public void | putAll(Map<K, V>
mappings to be stored in this map t)Implements java. |
| public Object | remove(Object
key whose mapping is to be removed from the map key)Implements java. |
| public void | |
| public int | |
| public String | |
| public Collection | values()
Implements java. Collection view of the values contained in this map.
|
| bean | back to summary |
|---|---|
| protected Object bean | |
| REQUIRE_GETTER | back to summary |
|---|---|
| public static final int REQUIRE_GETTER Limit the properties reflected in the key set of the map to readable properties.
| |
| REQUIRE_SETTER | back to summary |
|---|---|
| public static final int REQUIRE_SETTER Limit the properties reflected in the key set of the map to writable properties.
| |
| BeanMap | back to summary |
|---|---|
| protected BeanMap() | |
| BeanMap | back to summary |
|---|---|
| protected BeanMap(Object bean) | |
| clear | back to summary |
|---|---|
| public void clear() Implements java. Doc from java. Removes all of the mappings from this map (optional operation). The map will be empty after this call returns.
| |
| containsKey | back to summary |
|---|---|
| public boolean containsKey(Object key) Implements java. Doc from java. Returns | |
| containsValue | back to summary |
|---|---|
| public boolean containsValue(Object value) Implements java. Doc from java. Returns | |
| create | back to summary |
|---|---|
| public static BeanMap create(Object bean) Helper method to create a new | |
| entrySet | back to summary |
|---|---|
| public Set Implements java. Doc from java. Returns a | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Implements java. Doc from java. Compares the specified object with this map for equality. Returns
| |
| get | back to summary |
|---|---|
| public Object get(Object key) Implements java. Doc from java. Returns the value to which the specified key is mapped,
or More formally, if this map contains a mapping from a key
If this map permits null values, then a return value of
| |
| get | back to summary |
|---|---|
| public abstract Object get(Object bean, Object key) Get the property of a bean. This allows a | |
| getBean | back to summary |
|---|---|
| public Object getBean() Return the bean currently in use by this map. | |
| getPropertyType | back to summary |
|---|---|
| public abstract Class Get the type of a property. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements java. Doc from java. Returns the hash code value for this map. The hash code of a map is
defined to be the sum of the hash codes of each entry in the map's
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements java. Doc from java. Returns
| |
| newInstance | back to summary |
|---|---|
| public abstract BeanMap newInstance(Object bean) Create a new | |
| put | back to summary |
|---|---|
| public Object put(Object key, Object value) Implements java. Doc from java. Associates the specified value with the specified key in this map
(optional operation). If the map previously contained a mapping for
the key, the old value is replaced by the specified value. (A map
| |
| put | back to summary |
|---|---|
| public abstract Object put(Object bean, Object key, Object value) Set the property of a bean. This allows a | |
| putAll | back to summary |
|---|---|
| public void putAll(Map<K, V> t) Implements java. Doc from java. Copies all of the mappings from the specified map to this map
(optional operation). The effect of this call is equivalent to that
of calling | |
| remove | back to summary |
|---|---|
| public Object remove(Object key) Implements java. Doc from java. Removes the mapping for a key from this map if it is present
(optional operation). More formally, if this map contains a mapping
from key Returns the value to which this map previously associated the key,
or If this map permits null values, then a return value of
The map will not contain a mapping for the specified key once the call returns. | |
| setBean | back to summary |
|---|---|
| public void setBean(Object bean) Change the underlying bean this map should use. | |
| size | back to summary |
|---|---|
| public int size() Implements java. Doc from java. Returns the number of key-value mappings in this map. If the
map contains more than
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| values | back to summary |
|---|---|
| public Collection Implements java. Doc from java. Returns a
| |
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static interface |
| Modifier and Type | Field and Description |
|---|---|
| private Object | |
| private Class | |
| private static final BeanMap. | |
| private int | |
| private static final AbstractClassGenerator. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public BeanMap | |
| protected Object | firstInstance(Class<T> type)
Implements abstract org. |
| public void | |
| protected ClassLoader | |
| protected ProtectionDomain | getProtectionDomain()
Overrides org. |
| protected Object | nextInstance(Object instance)
Implements abstract org. |
| public void | |
| public void | setBeanClass(Class<T>
the class of the bean beanClass)Set the class of the bean that the generated map should support. |
| public void | setRequire(int
any combination of require)REQUIRE_GETTER and
REQUIRE_SETTER; default is zero (any property allowed)Limit the properties reflected by the generated map. |
| bean | back to summary |
|---|---|
| private Object bean | |
| beanClass | back to summary |
|---|---|
| private Class<T> beanClass | |
| KEY_FACTORY | back to summary |
|---|---|
| private static final BeanMap. | |
| require | back to summary |
|---|---|
| private int require | |
| SOURCE | back to summary |
|---|---|
| private static final AbstractClassGenerator. | |
| Generator | back to summary |
|---|---|
| public Generator() | |
| create | back to summary |
|---|---|
| public BeanMap create() Create a new instance of the | |
| firstInstance | back to summary |
|---|---|
| protected Object firstInstance(Class<T> type) Implements abstract org.
| |
| generateClass | back to summary |
|---|---|
| public void generateClass(ClassVisitor v) throws Exception Implements org.
| |
| getDefaultClassLoader | back to summary |
|---|---|
| protected ClassLoader getDefaultClassLoader() Implements abstract org.
| |
| getProtectionDomain | back to summary |
|---|---|
| protected ProtectionDomain getProtectionDomain() Overrides org. Doc from org. Returns the protection domain to use when defining the class.
Default implementation returns
| |
| nextInstance | back to summary |
|---|---|
| protected Object nextInstance(Object instance) Implements abstract org.
| |
| setBean | back to summary |
|---|---|
| public void setBean(Object bean) Set the bean that the generated map should reflect. The bean may be swapped
out for another bean of the same type using
| |
| setBeanClass | back to summary |
|---|---|
| public void setBeanClass(Class<T> beanClass) Set the class of the bean that the generated map should support.
You must call either this method or
| |
| setRequire | back to summary |
|---|---|
| public void setRequire(int require) Limit the properties reflected by the generated map.
| |
| Modifier and Type | Method and Description |
|---|---|
| public Object |
| newInstance | back to summary |
|---|---|
| public Object newInstance(Class<T> type, int require) | |