public class MapBean extends HashMap<String,Object> implements DynamicBean
Bean based on an exposed Map.
Properties are dynamic, and can be added and removed at will from the map.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
MapBean() |
| Modifier and Type | Method and Description |
|---|---|
MetaBean |
metaBean()
Gets the meta-bean representing the parts of the bean that are
common across all instances, such as the set of meta-properties.
|
Property<Object> |
property(String name)
Gets a property by name.
|
void |
propertyDefine(String propertyName,
Class<?> propertyType)
Adds a property to those allowed to be stored in the bean.
|
Set<String> |
propertyNames()
Gets the set of property names.
|
void |
propertyRemove(String propertyName)
Removes a property by name.
|
String |
toString()
Returns a string that summarises the bean.
|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, valuesequals, hashCodepublic MapBean()
public MetaBean metaBean()
Beanpublic Property<Object> property(String name)
Beanpublic Set<String> propertyNames()
BeanpropertyNames in interface Beanpublic void propertyDefine(String propertyName, Class<?> propertyType)
DynamicBeanSome implementations will automatically add properties, in which case this method will have no effect.
propertyDefine in interface DynamicBeanpropertyName - the property name to check, not empty, not nullpropertyType - the property type, not nullpublic void propertyRemove(String propertyName)
DynamicBeanpropertyRemove in interface DynamicBeanpropertyName - the property name to remove, null ignoredCopyright © 2007–2013 Joda.org. All rights reserved.