repo1.maven.org$maven2@org.apache.wicket$wicket@1.3.6@org$apache$wicket$model$LoadableDetachableModel.java
oh
o
[{"sl":-1,"sc":-1,"el":-1,"ec":-1,"m":"The field org.apache.wicket.model.LoadableDetachableModel.transientModelObject is transient but isn't set by deserialization","p":3,"t":"SE_TRANSIENT_FIELD_NOT_RESTORED","a":"Se","c":"BAD_PRACTICE"},{"sl":-1,"sc":-1,"el":-1,"ec":-1,"m":"The field org.apache.wicket.model.LoadableDetachableModel.attached is transient but isn't set by deserialization","p":4,"t":"SE_TRANSIENT_FIELD_NOT_RESTORED","a":"Se","c":"BAD_PRACTICE"}]
package org.apache.wicket.model;
Model that makes working with detachable models a breeze. LoadableDetachableModel holds a
temporary, transient model object, that is set when
AbstractReadOnlyModel.getObject(org.apache.wicket.Component) is called by
calling abstract method 'load', and that will be reset/ set to null on
detach().
A usage example:
LoadableDetachableModel venueListModel = new LoadableDetachableModel()
{
protected Object load()
{
return getVenueDao().findVenues();
}
};
Though you can override methods onAttach() and onDetach() for additional
attach/ detach behavior, the point of this class is to hide as much of the attaching/ detaching
as possible. So you should rarely need to override those methods, if ever.
- Author(s):
- Eelco Hillenius
- Igor Vaynberg
keeps track of whether this model is attached or detached
private transient boolean attached = false;
temporary, transient object.
This constructor is used if you already have the object retrieved and want to wrap it with a
detachable model.
- Parameters:
object
retrieved instance of the detachable object
log.debug("removed transient object for " + this + ", requestCycle " + ", requestCycle " + RequestCycle.get());
Gets the attached status of this model instance
- Returns:
- true if the model is attached, false otherwise
Loads and returns the (temporary) model object.
- Returns:
- the (temporary) model object
Attaches to the current request. Implement this method with custom behavior, such as loading
the model object.
Detaches from the current request. Implement this method with custom behavior, such as
setting the model object to null.