java.lang.Object
org.apache.wicket.model.ChainingModel<T>
- Type Parameters:
T
- The Model object type
- All Implemented Interfaces:
Serializable
,IDetachable
,IModel<T>
,IClusterable
- Direct Known Subclasses:
AbstractPropertyModel
,CompoundPropertyModel
This model and its subclasses support chaining of IModels.
getObject()
of
ChainingModel
returns its object like this:
if ( object instanceof IModel) { return ((IModel)object).getObject()} else return object;ChainingModel also detaches the inner model on detach.
- Since:
- 6.0.0
- See Also:
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
ChainingModel
-
-
Method Details
-
detach
Unsets this property model's instance variables and detaches the model.- Specified by:
detach
in interfaceIDetachable
- Specified by:
detach
in interfaceIModel<T>
- See Also:
-
setObject
Description copied from interface:IModel
Sets the model object. -
getObject
Description copied from interface:IModel
Gets the model object. -
getTarget
- Returns:
- The target - object or model
-
setTarget
Sets a new target - object or model- Returns:
- this object
-
getChainedModel
- Returns:
- The target - if it is a model, null otherwise
-
toString
-
getInnermostModelOrObject
- Returns:
- The innermost model or the object if the target is not a model
-