Package io.github.astrapi69.model
Class AbstractPropertyModel<T>
- java.lang.Object
-
- io.github.astrapi69.model.ChainingModel<T>
-
- io.github.astrapi69.model.AbstractPropertyModel<T>
-
- Type Parameters:
T
- the generic type
- All Implemented Interfaces:
Attachable
,IChainingModel<T>
,IDetachable
,IModel<T>
,IObjectClassAwareModel<T>
,IPropertyReflectionAwareModel<T>
,java.io.Serializable
- Direct Known Subclasses:
PropertyModel
public abstract class AbstractPropertyModel<T> extends ChainingModel<T> implements IObjectClassAwareModel<T>, IPropertyReflectionAwareModel<T>
The classAbstractPropertyModel
serves as a base class for different kinds of property models. By default, this class usesPropertyResolver
to resolve expressions on the target model object.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractPropertyModel(java.lang.Object modelObject)
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getInnermostModelOrObject()
T
getObject()
Gets the model object.java.lang.Class<T>
getObjectClass()
Gets the object class.java.lang.String
getPropertyExpression()
Gets the property expression for this modeljava.lang.reflect.Field
getPropertyField()
Gets the field of model property or null if the field doesn't exist.java.lang.reflect.Method
getPropertyGetter()
Gets the getter method of model property or null if the method doesn't exist.java.lang.reflect.Method
getPropertySetter()
Gets the setter method of model property or null if the method doesn't exist.protected abstract java.lang.String
propertyExpression()
void
setObject(T object)
Applies the property expression on the model object using the given object argument.-
Methods inherited from class io.github.astrapi69.model.ChainingModel
attach, detach, getChainedModel, getTarget, setChainedModel, setTarget, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.github.astrapi69.model.api.Attachable
attach
-
Methods inherited from interface io.github.astrapi69.model.api.IDetachable
detach
-
-
-
-
Method Detail
-
getInnermostModelOrObject
public final java.lang.Object getInnermostModelOrObject()
- Returns:
- The innermost model or the object if the target is not a model
-
getObject
public T getObject()
Gets the model object.
-
setObject
public void setObject(T object)
Applies the property expression on the model object using the given object argument.
-
getObjectClass
public java.lang.Class<T> getObjectClass()
Description copied from interface:IObjectClassAwareModel
Gets the object class.- Specified by:
getObjectClass
in interfaceIObjectClassAwareModel<T>
- Returns:
- model object class
-
getPropertyExpression
public final java.lang.String getPropertyExpression()
Gets the property expression for this model- Returns:
- The property expression
-
getPropertyField
public java.lang.reflect.Field getPropertyField()
Description copied from interface:IPropertyReflectionAwareModel
Gets the field of model property or null if the field doesn't exist.- Specified by:
getPropertyField
in interfaceIPropertyReflectionAwareModel<T>
- Returns:
- the property field
-
getPropertyGetter
public java.lang.reflect.Method getPropertyGetter()
Gets the getter method of model property or null if the method doesn't exist.- Specified by:
getPropertyGetter
in interfaceIPropertyReflectionAwareModel<T>
- Returns:
- Method or null
-
getPropertySetter
public java.lang.reflect.Method getPropertySetter()
Gets the setter method of model property or null if the method doesn't exist.- Specified by:
getPropertySetter
in interfaceIPropertyReflectionAwareModel<T>
- Returns:
- Method or null
-
propertyExpression
protected abstract java.lang.String propertyExpression()
- Returns:
- The property expression for the component
-
-