public class BeanMap
extends java.util.AbstractMap
implements java.lang.Cloneable
If an exception occurs during attempts to get or set a property then the property is considered non existent in the Map
Modifier and Type | Field and Description |
---|---|
static java.util.HashMap |
defaultTransformers
Deprecated.
Maps primitive Class types to transformers.
|
static java.lang.Object[] |
NULL_ARGUMENTS
Deprecated.
An empty array.
|
Constructor and Description |
---|
BeanMap()
Deprecated.
Constructs a new empty
BeanMap . |
BeanMap(java.lang.Object bean)
Deprecated.
Constructs a new
BeanMap that operates on the
specified bean. |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Deprecated.
This method reinitializes the bean map to have default values for the
bean's properties.
|
java.lang.Object |
clone()
Deprecated.
Clone this bean map using the following process:
If there is no underlying bean, return a cloned BeanMap without a
bean.
|
boolean |
containsKey(java.lang.Object name)
Deprecated.
Returns true if the bean defines a property with the given name.
|
boolean |
containsValue(java.lang.Object value)
Deprecated.
Returns true if the bean defines a property whose current value is
the given object.
|
java.util.Iterator |
entryIterator()
Deprecated.
Convenience method for getting an iterator over the entries.
|
java.util.Set |
entrySet()
Deprecated.
Gets a Set of MapEntry objects that are the mappings for this BeanMap.
|
java.lang.Object |
get(java.lang.Object name)
Deprecated.
Returns the value of the bean's property with the given name.
|
java.lang.Object |
getBean()
Deprecated.
Returns the bean currently being operated on.
|
java.lang.reflect.Method |
getReadMethod(java.lang.String name)
Deprecated.
Returns the accessor for the property with the given name.
|
java.lang.Class |
getType(java.lang.String name)
Deprecated.
Returns the type of the property with the given name.
|
java.lang.reflect.Method |
getWriteMethod(java.lang.String name)
Deprecated.
Returns the mutator for the property with the given name.
|
java.util.Iterator |
keyIterator()
Deprecated.
Convenience method for getting an iterator over the keys.
|
java.util.Set |
keySet()
Deprecated.
Get the keys for this BeanMap.
|
java.lang.Object |
put(java.lang.Object name,
java.lang.Object value)
Deprecated.
Sets the bean property with the given name to the given value.
|
void |
putAllWriteable(BeanMap map)
Deprecated.
Puts all of the writable properties from the given BeanMap into this
BeanMap.
|
void |
setBean(java.lang.Object newBean)
Deprecated.
Sets the bean to be operated on by this map.
|
int |
size()
Deprecated.
Returns the number of properties defined by the bean.
|
java.lang.String |
toString()
Deprecated.
|
java.util.Iterator |
valueIterator()
Deprecated.
Convenience method for getting an iterator over the values.
|
java.util.Collection |
values()
Deprecated.
Returns the values for the BeanMap.
|
public static final java.lang.Object[] NULL_ARGUMENTS
public static java.util.HashMap defaultTransformers
public BeanMap()
BeanMap
.public BeanMap(java.lang.Object 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 java.lang.String toString()
toString
in class java.util.AbstractMap
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.util.AbstractMap
java.lang.CloneNotSupportedException
public void putAllWriteable(BeanMap 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).clear
in interface java.util.Map
clear
in class java.util.AbstractMap
public boolean containsKey(java.lang.Object name)
The given name must be a String
; if not, this method
returns false. This method will also return false if the bean
does not define a property with that name.
Write-only properties will not be matched as the test operates against property read methods.
containsKey
in interface java.util.Map
containsKey
in class java.util.AbstractMap
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 boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map
containsValue
in class java.util.AbstractMap
value
- the value to checkpublic java.lang.Object get(java.lang.Object name)
The given name must be a 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.
Write-only properties will not be matched as the test operates against property read methods.
get
in interface java.util.Map
get
in class java.util.AbstractMap
name
- the name of the property whose value to returnpublic java.lang.Object put(java.lang.Object name, java.lang.Object value) throws java.lang.IllegalArgumentException, java.lang.ClassCastException
put
in interface java.util.Map
put
in class java.util.AbstractMap
name
- the name of the property to setvalue
- the value to set that property tojava.lang.IllegalArgumentException
- 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-onlyjava.lang.ClassCastException
public int size()
size
in interface java.util.Map
size
in class java.util.AbstractMap
public java.util.Set keySet()
Write-only properties are not included in the returned set of property names, although it is possible to set their value and to get their type.
keySet
in interface java.util.Map
keySet
in class java.util.AbstractMap
public java.util.Set entrySet()
Each MapEntry can be set but not removed.
entrySet
in interface java.util.Map
entrySet
in class java.util.AbstractMap
public java.util.Collection values()
values
in interface java.util.Map
values
in class java.util.AbstractMap
public java.lang.Class getType(java.lang.String name)
name
- the name of the propertynull
if no such
property existspublic java.util.Iterator keyIterator()
Write-only properties will not be returned in the iterator.
public java.util.Iterator valueIterator()
public java.util.Iterator entryIterator()
public java.lang.Object getBean()
public void setBean(java.lang.Object newBean)
newBean
- the new bean to operate onpublic java.lang.reflect.Method getReadMethod(java.lang.String name)
name
- the name of the propertypublic java.lang.reflect.Method getWriteMethod(java.lang.String name)
name
- the name of the propertyCopyright © 2010 - 2020 Adobe. All Rights Reserved