java.lang.Object
io.github.mmm.bean.AbstractBean
io.github.mmm.bean.AbstractVirtualBean
- All Implemented Interfaces:
ReadableBean,VirtualBean,WritableBean,io.github.mmm.marshall.MarshallableObject,io.github.mmm.marshall.Marshaller<Object>,io.github.mmm.marshall.Marshalling<Object>,io.github.mmm.marshall.MarshallingObject,io.github.mmm.marshall.UnmarshallableObject,io.github.mmm.marshall.Unmarshaller<Object>,AttributeReadOnly,io.github.mmm.validation.Validatable,io.github.mmm.value.ReadablePath,io.github.mmm.value.WritablePath
- Direct Known Subclasses:
AdvancedBean
Implementation of
VirtualBean as regular java class. Extend your beans from this class if you need virtual
and dynamic typing.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.mmm.value.ReadablePath
io.github.mmm.value.ReadablePath.PathBuilder -
Field Summary
Fields inherited from interface io.github.mmm.bean.ReadableBean
PROPERTY_TYPE_ID, PROPERTY_TYPE_NAME, SUFFIX_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractBeancreate()Creates a new instance of thisBeanimplementation.Collection<? extends WritableProperty<?>>getProperty(String name) intgetType()booleanfinal booleanprotected booleanprotected voidonPropertyAdded(WritableProperty<?> property) protected voidMethods inherited from class io.github.mmm.bean.AbstractBean
add, add, addProperty, copy, createProperty, createPropertyBuilders, getAliases, isLockOwnerInternal, isReadOnly, newInstance, parentPath, parentPath, path, pathSegment, pathSegment, registerAlias, registerAliases, requireDynamic, requireWritable, toString, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.mmm.property.AttributeReadOnly
isReadOnlyMethods inherited from interface io.github.mmm.marshall.MarshallableObject
write, writeObjectMethods inherited from interface io.github.mmm.bean.ReadableBean
copy, doEquals, doToString, get, getAliases, isEqualTo, isPolymorphic, mapPropertyIds, newInstance, toString, validateMethods inherited from interface io.github.mmm.value.ReadablePath
parentPath, path, path, pathMethods inherited from interface io.github.mmm.marshall.UnmarshallableObject
readObjectMethods inherited from interface io.github.mmm.validation.Validatable
validateOrThrowMethods inherited from interface io.github.mmm.bean.VirtualBean
isInstanceOfMethods inherited from interface io.github.mmm.bean.WritableBean
addProperty, createProperty, createProperty, getOrCreateProperty, getOrCreateProperty, getRequiredProperty, pathSegment, pathSegment, read, set, set, set, setDynamicMethods inherited from interface io.github.mmm.value.WritablePath
parentPath
-
Constructor Details
-
AbstractVirtualBean
public AbstractVirtualBean()The constructor. -
AbstractVirtualBean
The constructor.- Parameters:
type- thetype.
-
-
Method Details
-
isDynamic
public boolean isDynamic()- Specified by:
isDynamicin interfaceReadableBean- Overrides:
isDynamicin classAbstractBean- Returns:
trueif thisBeanis dynamic meaning that is not strictly typed but allows to dynamically add properties,falseotherwise.- See Also:
-
isThreadSafe
protected boolean isThreadSafe()- Overrides:
isThreadSafein classAbstractBean- Returns:
trueif theBeanshall be thread-safe (use concurrent collections, etc.),falseotherwise.
-
isPrototype
public final boolean isPrototype()- Specified by:
isPrototypein interfaceReadableBean- Returns:
trueif thisBeanis aBeanClass,falseotherwise (it is a regular instance).- See Also:
-
getType
- Specified by:
getTypein interfaceReadableBean- Specified by:
getTypein interfaceVirtualBean- Returns:
- the
BeanTypereflecting thisBean. - See Also:
-
create
Description copied from class:AbstractBeanCreates a new instance of thisBeanimplementation. The default implementation uses reflection. To improve performance please override this method. Please note, that if you do so, you also need to override this method again for all sub-classes of the hierarchy.- Overrides:
createin classAbstractBean- Returns:
- the new
Beaninstance. Has to be of the same type as thecurrent class.
-
getProperty
- Specified by:
getPropertyin interfaceReadableBean- Specified by:
getPropertyin interfaceWritableBean- Overrides:
getPropertyin classAbstractBean- Parameters:
name- thenameof the requested property or a potentialaliasof the property.- Returns:
- the requested
WritablePropertyornullif no such property exists. - See Also:
-
getPropertyCount
public int getPropertyCount()- Specified by:
getPropertyCountin interfaceReadableBean- Overrides:
getPropertyCountin classAbstractBean- Returns:
- the number of
propertiesof thisReadableBean.
-
getProperties
- Specified by:
getPropertiesin interfaceReadableBean- Specified by:
getPropertiesin interfaceWritableBean- Overrides:
getPropertiesin classAbstractBean- Returns:
- a
Collectionwith allpropertiesof this bean.
-
onPropertyAdded
- Overrides:
onPropertyAddedin classAbstractBean- Parameters:
property- theWritablePropertythat has been added.
-
updateProperties
protected void updateProperties()
-