| 限定符和类型 | 类和说明 |
|---|---|
protected static class |
BeanMap.Entry<T>
Map entry used by
BeanMap. |
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| 限定符和类型 | 字段和说明 |
|---|---|
protected T |
bean
An empty array.
|
protected Class<T> |
beanClass |
protected Map<String,ameba.util.bean.BeanMap.HandleType> |
readHandleType |
protected Map<String,BeanInvoker> |
readInvokers |
protected BeanTransformer |
transformer |
protected Map<String,Class<?>> |
types |
protected Map<String,BeanInvoker> |
writeInvokers |
| 构造器和说明 |
|---|
BeanMap()
Constructs a new empty
BeanMap. |
BeanMap(T bean)
Constructs a new
BeanMap that operates on the
specified bean. |
BeanMap(T bean,
BeanTransformer beanTransformer) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear()
This method reinitializes the bean map to have default values for the
bean's properties.
|
Object |
clone()
Clone this bean map using the following process:
If there is no underlying bean, return a cloned BeanMap without a bean. |
boolean |
containsKey(Object name)
Returns true if the bean defines a property with the given name.
|
Iterator<Map.Entry<String,Object>> |
entryIterator()
Convenience method for getting an iterator over the entries.
|
Set<Map.Entry<String,Object>> |
entrySet()
Gets a Set of MapEntry objects that are the mappings for this BeanMap.
|
protected void |
firePropertyChange(Object key,
Object oldValue,
Object newValue)
Called during a successful
AbstractMap.put(Object, Object) operation. |
Object |
get(Object name)
Returns the value of the bean's property with the given name.
|
T |
getBean()
Returns the bean currently being operated on.
|
String |
getBeanName() |
BeanInvoker |
getReadInvoker(String name)
Returns the accessor for the property with the given name.
|
Class<?> |
getType(String name)
Returns the type of the property with the given name.
|
BeanInvoker |
getWriteInvoker(String name)
Returns the mutator for the property with the given name.
|
protected void |
initialise() |
Iterator<String> |
keyIterator()
Convenience method for getting an iterator over the keys.
|
Set<String> |
keySet()
Get the keys for this BeanMap.
|
Object |
put(String name,
Object value)
Sets the bean property with the given name to the given value.
|
void |
putAllWriteable(BeanMap<T> map)
Puts all of the writable properties from the given BeanMap into this
BeanMap.
|
protected void |
reinitialise()
Reinitializes this bean.
|
void |
set(String name,
Object value) |
void |
setBean(T newBean)
Sets the bean to be operated on by this map.
|
int |
size()
Returns the number of properties defined by the bean.
|
String |
toString()
Renders a string representation of this object.
|
protected Object |
transform(BeanInvoker invoker) |
protected String |
transformPropertyName(String name) |
Iterator<Object> |
valueIterator()
Convenience method for getting an iterator over the values.
|
Collection<Object> |
values()
Returns the values for the BeanMap.
|
containsValue, equals, hashCode, isEmpty, putAll, removeprotected BeanTransformer transformer
protected transient T bean
protected transient Map<String,BeanInvoker> readInvokers
protected transient Map<String,BeanInvoker> writeInvokers
public BeanMap()
BeanMap.public BeanMap(T bean)
BeanMap that operates on the
specified bean. If the given bean is null, then
this map will be empty.bean - the bean for this map to operate onpublic BeanMap(T bean, BeanTransformer beanTransformer)
public String getBeanName()
public String toString()
toString 在类中 AbstractMap<String,Object>String representation of this objectpublic Object clone() throws CloneNotSupportedException
clone 在类中 AbstractMap<String,Object>CloneNotSupportedException - if the underlying bean
cannot be clonedpublic void putAllWriteable(BeanMap<T> map)
map - the BeanMap whose properties to putpublic void clear()
clear() differs from the Map contract in that
the mappings are not actually removed from the map (the mappings for a
BeanMap are fixed).public boolean containsKey(Object name)
String; if not, this method
returns false. This method will also return false if the bean
does not define a property with that name.
containsKey 在接口中 Map<String,Object>containsKey 在类中 AbstractMap<String,Object>name - the name of the property to checkString;
false if the bean does not define a property with that name; or
true if the bean does define a property with that namepublic Object get(Object name)
String and must not be
null; otherwise, this method returns null.
If the bean defines a property with the given name, the value of
that property is returned. Otherwise, null is
returned.
protected Object transform(BeanInvoker invoker) throws Throwable
Throwablepublic Object put(String name, Object value) throws IllegalArgumentException, ClassCastException
put 在接口中 Map<String,Object>put 在类中 AbstractMap<String,Object>name - the name of the property to setvalue - the value to set that property toIllegalArgumentException - if the given name is null;
if the given name is not a String; if the bean doesn't
define a property with that name; or if the bean property with
that name is read-onlyClassCastException - if an error occurs creating the method argspublic void set(String name, Object value) throws IllegalArgumentException, ClassCastException
public int size()
public Set<String> keySet()
public Set<Map.Entry<String,Object>> entrySet()
public Collection<Object> values()
public Class<?> getType(String name)
name - the name of the propertynull if no such
property existspublic Iterator<String> keyIterator()
public Iterator<Object> valueIterator()
public Iterator<Map.Entry<String,Object>> entryIterator()
public T getBean()
public void setBean(T newBean)
newBean - the new bean to operate onpublic BeanInvoker getReadInvoker(String name)
name - the name of the propertypublic BeanInvoker getWriteInvoker(String name)
name - the name of the propertyprotected void reinitialise()
setBean(Object).
Does introspection to find properties.protected void initialise()
protected void firePropertyChange(Object key, Object oldValue, Object newValue)
AbstractMap.put(Object, Object) operation.
Default implementation does nothing. Override to be notified of
property changes in the bean caused by this map.key - the name of the property that changedoldValue - the old value for that propertynewValue - the new value for that propertyCopyright © 2014–2016. All rights reserved.