| org.apache.wicket.model.IModel
All known Subclasses: org.apache.wicket.model.ComponentDetachableModel, org.apache.wicket.model.Model, org.apache.wicket.markup.html.list.ListItemModel, org.apache.wicket.model.AbstractReadOnlyModel, org.apache.wicket.feedback.FeedbackMessagesModel, org.apache.wicket.extensions.model.AbstractCheckBoxModel, org.apache.wicket.model.ComponentModel,
IModel | public interface IModel extends IDetachable(Code) | | A IModel wraps the actual model Object used by a Component. IModel
implementations are used as a facade for the real model so that users have
control over the actual persistence strategy. Note that objects implementing
this interface will be stored in the Session. Hence, you should use
(non-transient) instance variables sparingly.
- Basic Models - To implement a basic (non-detachable) model which
holds its entire state in the Session, you can either subclass
AbstractModel , or use the simple model wrapper
Model directly.
- Detachable Models - IModel inherits a hook,
IDetachable.detach , so that interface implementers can detach
transient information when a model is no longer being actively used by the
framework. This reduces memory use and reduces the expense of replicating the
model in a clustered server environment. To implement a detachable model, you
should generally extend
org.apache.wicket.model.AbstractDetachableModel instead
of implementing IModel directly.
- Property Models - The AbstractPropertyModel class provides
default functionality for property models. A property model provides access
to a particular property of its wrapped model.
- Compound Property Models - The IModel interface is parameterized
by Component, allowing a model to be shared among several Components. When
the
IModel.getObject method is called, the value returned will
depend on the Component which is asking for the value. Likewise, the
IModel.setObject(Object) method sets a different property depending
on which Component is doing the setting. For more information on
CompoundPropertyModels and model inheritance, see
org.apache.wicket.model.CompoundPropertyModel and
org.apache.wicket.Page .
See Also: org.apache.wicket.Component.sameInnermostModel(org.apache.wicket.Component) See Also: org.apache.wicket.Component.sameInnermostModel(IModel) author: Chris Turner author: Eelco Hillenius author: Jonathan Locke author: TODO 3.0: Vote on renaming get/setObject to get/setValue |
getObject | Object getObject()(Code) | | Gets the model object.
The model object |
setObject | void setObject(Object object)(Code) | | Sets the model object.
Parameters: object - The model object |
|
|