Package org.springframework.cglib.beans
Class BeanMap
java.lang.Object
org.springframework.cglib.beans.BeanMap
- All Implemented Interfaces:
- Map
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).- Author:
- Chris Nokleberg
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected Objectstatic final intLimit the properties reflected in the key set of the map to readable properties.static final intLimit the properties reflected in the key set of the map to writable properties.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) static BeanMapHelper method to create a newBeanMap.entrySet()booleanabstract ObjectGet the property of a bean.getBean()Return the bean currently in use by this map.abstract ClassgetPropertyType(String name) Get the type of a property.inthashCode()booleanisEmpty()abstract BeanMapnewInstance(Object bean) Create a newBeanMapinstance using the specified bean.abstract ObjectSet the property of a bean.voidvoidChange the underlying bean this map should use.intsize()toString()values()Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Mapcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, keySet, merge, putIfAbsent, remove, replace, replace, replaceAll
- 
Field Details- 
REQUIRE_GETTERpublic static final int REQUIRE_GETTERLimit the properties reflected in the key set of the map to readable properties.
- 
REQUIRE_SETTERpublic static final int REQUIRE_SETTERLimit the properties reflected in the key set of the map to writable properties.
- 
bean
 
- 
- 
Constructor Details- 
BeanMapprotected BeanMap()
- 
BeanMap
 
- 
- 
Method Details- 
createHelper method to create a newBeanMap. For finer control over the generated instance, use a new instance ofBeanMap.Generatorinstead of this static method.- Parameters:
- bean- the JavaBean underlying the map
- Returns:
- a new BeanMapinstance
 
- 
newInstanceCreate a newBeanMapinstance using the specified bean. This is faster than using thecreate(java.lang.Object)static method.- Parameters:
- bean- the JavaBean underlying the map
- Returns:
- a new BeanMapinstance
 
- 
getPropertyTypeGet the type of a property.- Parameters:
- name- the name of the JavaBean property
- Returns:
- the type of the property, or null if the property does not exist
 
- 
get
- 
put
- 
getGet the property of a bean. This allows aBeanMapto 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.- Parameters:
- bean- the bean to query; must be compatible with the type of this- BeanMap
- key- must be a String
- Returns:
- the current value, or null if there is no matching property
 
- 
putSet the property of a bean. This allows aBeanMapto 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.- Parameters:
- key- must be a String
- Returns:
- the old value, if there was one, or null
 
- 
setBeanChange the underlying bean this map should use.- Parameters:
- bean- the new JavaBean
- See Also:
 
- 
getBeanReturn the bean currently in use by this map.- Returns:
- the current JavaBean
- See Also:
 
- 
clearpublic void clear()
- 
containsKey- Specified by:
- containsKeyin interface- Map
 
- 
containsValue- Specified by:
- containsValuein interface- Map
 
- 
sizepublic int size()
- 
isEmptypublic boolean isEmpty()
- 
remove
- 
putAll
- 
equals
- 
hashCodepublic int hashCode()
- 
entrySet
- 
values
- 
toString
 
-