public abstract class ReloadableDetachableModel<T> extends Object implements org.apache.wicket.model.IModel<T>
| Constructor and Description |
|---|
ReloadableDetachableModel()
Construct.
|
ReloadableDetachableModel(T object)
This constructor is used if you already have the object retrieved and want to wrap it with a
detachable model.
|
| Modifier and Type | Method and Description |
|---|---|
void |
detach() |
T |
getObject() |
boolean |
isAttached()
Gets the attached status of this model instance
|
protected abstract T |
load()
Loads and returns the (temporary) model object.
|
protected boolean |
needsReload(T cachedObject) |
protected void |
onAttach()
Attaches to the current request.
|
protected void |
onDetach()
Detaches from the current request.
|
void |
setObject(T object)
Manually loads the model with the specified object.
|
String |
toString() |
public ReloadableDetachableModel()
public ReloadableDetachableModel(T object)
object - retrieved instance of the detachable objectpublic void detach()
detach in interface org.apache.wicket.model.IDetachableIDetachable.detach()public final T getObject()
getObject in interface org.apache.wicket.model.IModel<T>IModel.getObject()protected boolean needsReload(T cachedObject)
public final boolean isAttached()
public String toString()
toString in class ObjectObject.toString()protected abstract T load()
protected void onAttach()
protected void onDetach()
public void setObject(T object)
getObject()
will return object until detach() is called.setObject in interface org.apache.wicket.model.IModel<T>object - The object to set into the modelCopyright © 2018. All rights reserved.