Package org.apache.wicket.model
Class ComponentPropertyModel<T>
- java.lang.Object
-
- org.apache.wicket.model.ComponentPropertyModel<T>
-
- Type Parameters:
T
- The Model object
- All Implemented Interfaces:
Serializable
,IComponentAssignedModel<T>
,IDetachable
,IModel<T>
,IClusterable
public class ComponentPropertyModel<T> extends Object implements IComponentAssignedModel<T>
A model that references a property by name on the current model of the component it is bound to. This enables direct usage of inherited models such as compound property models.- Author:
- Jonathan Locke
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ComponentPropertyModel(String propertyName)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getObject()
Gets the model object.void
setObject(T object)
Sets the model object.IWrapModel<T>
wrapOnAssignment(Component component)
This method is called when the component gets its model assigned.
-
-
-
Constructor Detail
-
ComponentPropertyModel
public ComponentPropertyModel(String propertyName)
Constructor- Parameters:
propertyName
- The name of the property to reference
-
-
Method Detail
-
setObject
public final void setObject(T object)
Description copied from interface:IModel
Sets the model object.
-
wrapOnAssignment
public IWrapModel<T> wrapOnAssignment(Component component)
Description copied from interface:IComponentAssignedModel
This method is called when the component gets its model assigned. WARNING: Because the model can be assigned in the constructor of component this method can also be called with a 'this' of a component that is not fully constructed yet.- Specified by:
wrapOnAssignment
in interfaceIComponentAssignedModel<T>
- Returns:
- The WrapModel that wraps this model
-
-