-
- All Superinterfaces:
Bean
public interface DynamicBean extends Bean
A dynamic bean that allows properties to be added and removed.A JavaBean is defined at compile-time and cannot have additional properties added. Instances of this interface allow additional properties to be added and removed probably by wrapping a map
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DynamicMetaBean
metaBean()
Gets the meta-bean representing the parts of the bean that are common across all instances, such as the set of meta-properties.<R> Property<R>
property(java.lang.String propertyName)
Gets a property by name.void
propertyDefine(java.lang.String propertyName, java.lang.Class<?> propertyType)
Adds a property to those allowed to be stored in the bean.void
propertyRemove(java.lang.String propertyName)
Removes a property by name.-
Methods inherited from interface org.joda.beans.Bean
propertyNames
-
-
-
-
Method Detail
-
metaBean
DynamicMetaBean 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
<R> Property<R> property(java.lang.String propertyName)
Gets a property by name.This will not throw an exception if the property name does not exist. Whether a property is immediately created or not is implementation dependent.
-
propertyDefine
void propertyDefine(java.lang.String propertyName, java.lang.Class<?> propertyType)
Adds a property to those allowed to be stored in the bean.Some implementations will automatically add properties, in which case this method will have no effect.
- Parameters:
propertyName
- the property name to check, not empty, not nullpropertyType
- the property type, not null
-
propertyRemove
void propertyRemove(java.lang.String propertyName)
Removes a property by name.- Parameters:
propertyName
- the property name to remove, null ignored
-
-