Package org.joda.beans
Interface DynamicMetaBean
-
- All Superinterfaces:
MetaBean
public interface DynamicMetaBean extends MetaBean
A dynamic meta-bean which works withDynamicBean.A dynamic bean can have properties added or removed at any time. As such, there is a different meta-bean for each dynamic bean. The meta-bean allows meta-properties to be created on demand.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Class<? extends DynamicBean>beanType()Get the type of the bean represented as aClass.BeanBuilder<? extends DynamicBean>builder()Creates a bean builder that can be used to create an instance of this bean.<R> MetaProperty<R>metaProperty(String propertyName)Gets a meta-property by name.voidmetaPropertyDefine(String propertyName, Class<?> propertyType)Defines a property for the bean.voidmetaPropertyRemove(String propertyName)Removes a property by name.-
Methods inherited from interface org.joda.beans.MetaBean
annotation, annotationOpt, annotations, beanName, isBuildable, metaPropertyCount, metaPropertyExists, metaPropertyIterable, metaPropertyMap
-
-
-
-
Method Detail
-
builder
BeanBuilder<? extends DynamicBean> builder()
Creates a bean builder that can be used to create an instance of this bean.All properties added to the builder will be created and appear in the result.
- Specified by:
builderin interfaceMetaBean- Returns:
- the bean builder, not null
- Throws:
UnsupportedOperationException- if the bean cannot be created
-
beanType
Class<? extends DynamicBean> beanType()
Get the type of the bean represented as aClass.
-
metaProperty
<R> MetaProperty<R> metaProperty(String propertyName)
Gets a meta-property by name.This will not throw an exception if the meta-property name does not exist. Whether a meta-property is immediately created or not is implementation dependent.
- Specified by:
metaPropertyin interfaceMetaBean- Type Parameters:
R- the property type, optional, enabling auto-casting- Parameters:
propertyName- the property name to retrieve, not null- Returns:
- the meta property, not null
-
metaPropertyDefine
void metaPropertyDefine(String propertyName, Class<?> propertyType)
Defines a property for 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
-
metaPropertyRemove
void metaPropertyRemove(String propertyName)
Removes a property by name.- Parameters:
propertyName- the property name to remove, null ignored
-
-