|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<String,Object>
org.joda.beans.impl.map.MapBean
public class MapBean
Implementation of a fully dynamic Bean based on an exposed Map.
Properties are dynamic, and can be added and removed at will from the map.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
| Constructor Summary | |
|---|---|
MapBean()
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.util.HashMap |
|---|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
| Methods inherited from class java.util.AbstractMap |
|---|
equals, hashCode |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public MapBean()
| Method Detail |
|---|
public MetaBean metaBean()
Bean
metaBean in interface Beanpublic Property<Object> property(String name)
Bean
property in interface Beanname - the property name to retrieve, null throws NoSuchElementException
public Set<String> propertyNames()
Bean
propertyNames in interface Bean
public 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)
DynamicBean
propertyRemove in interface DynamicBeanpropertyName - the property name to remove, null ignoredpublic String toString()
The string contains the class name and properties.
toString in class AbstractMap<String,Object>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||