java.lang.Object
org.apache.wicket.model.ChainingModel<T>
org.apache.wicket.model.AbstractPropertyModel<T>
- Type Parameters:
T
- The Model object type
- All Implemented Interfaces:
Serializable
,IDetachable
,IModel<T>
,IObjectClassAwareModel<T>
,IPropertyReflectionAwareModel<T>
,IClusterable
- Direct Known Subclasses:
PropertyModel
public abstract class AbstractPropertyModel<T>
extends ChainingModel<T>
implements IObjectClassAwareModel<T>, IPropertyReflectionAwareModel<T>
Serves as a base class for different kinds of property models. By default, this class uses
PropertyResolver
to resolve expressions on the target model object. Note that the
property resolver by default provides access to private members and methods. If guaranteeing
encapsulation of the target objects is a big concern, you should consider using an alternative
implementation.- Author:
- Chris Turner, Eelco Hillenius, Jonathan Locke
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the model object.Returns the class of model objectfinal String
Gets the property expression for this modelReturns the field of model property or null if the field doesn't exist.Returns the getter method of model property or null if the method doesn't exist.Returns the setter method of model property or null if the method doesn't exist.protected abstract String
void
Applies the property expression on the model object using the given object argument.Methods inherited from class org.apache.wicket.model.ChainingModel
detach, getChainedModel, getInnermostModelOrObject, getTarget, setTarget, toString
-
Constructor Details
-
AbstractPropertyModel
Constructor- Parameters:
modelObject
- The nested model object
-
-
Method Details
-
getObject
Description copied from interface:IModel
Gets the model object. -
getPropertyExpression
Gets the property expression for this model- Returns:
- The property expression
-
setObject
Applies the property expression on the model object using the given object argument. -
getObjectClass
Description copied from interface:IObjectClassAwareModel
Returns the class of model object- Specified by:
getObjectClass
in interfaceIObjectClassAwareModel<T>
- Returns:
- model object class
-
getPropertyField
Description copied from interface:IPropertyReflectionAwareModel
Returns the field of model property or null if the field doesn't exist.- Specified by:
getPropertyField
in interfaceIPropertyReflectionAwareModel<T>
- Returns:
- Field or null
-
getPropertyGetter
Description copied from interface:IPropertyReflectionAwareModel
Returns 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
Description copied from interface:IPropertyReflectionAwareModel
Returns 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
- Returns:
- The property expression for the component
-