Class LoadableModel<T>
- java.lang.Object
-
- com.evolveum.midpoint.gui.api.model.LoadableModel<T>
-
- All Implemented Interfaces:
Serializable
,org.apache.wicket.model.IDetachable
,org.apache.wicket.model.IModel<T>
,org.apache.wicket.util.io.IClusterable
- Direct Known Subclasses:
CountableLoadableModel
,NonEmptyLoadableModel
public abstract class LoadableModel<T> extends Object implements org.apache.wicket.model.IModel<T>
Lazy loading Wicket model. This is an IModel implementation that loads the model content only when needed. This is supposed to be used for objects that are expensive to load. So we can avoid loading the at all when a component that uses them is not visible.- Author:
- lazyman
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LoadableModel()
LoadableModel(boolean alwaysReload)
LoadableModel(T object)
LoadableModel(T object, boolean alwaysReload)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static <T> LoadableModel<T>
create(Producer<T> producer, boolean alwaysReload)
void
detach()
org.apache.wicket.model.IModel
getNestedModel()
T
getObject()
boolean
isLoaded()
protected abstract T
load()
protected void
onDetach()
protected void
onLoad()
void
reset()
void
revive(PrismContext prismContext)
void
setObject(T object)
String
toString()
-
-
-
Method Detail
-
create
public static <T> LoadableModel<T> create(Producer<T> producer, boolean alwaysReload)
-
getObject
public T getObject()
- Specified by:
getObject
in interfaceorg.apache.wicket.model.IModel<T>
-
setObject
public void setObject(T object)
- Specified by:
setObject
in interfaceorg.apache.wicket.model.IModel<T>
-
isLoaded
public boolean isLoaded()
-
reset
public void reset()
-
detach
public void detach()
- Specified by:
detach
in interfaceorg.apache.wicket.model.IDetachable
- Specified by:
detach
in interfaceorg.apache.wicket.model.IModel<T>
-
getNestedModel
public org.apache.wicket.model.IModel getNestedModel()
-
load
protected abstract T load()
-
onLoad
protected void onLoad()
-
onDetach
protected void onDetach()
-
revive
public void revive(PrismContext prismContext) throws SchemaException
- Throws:
SchemaException
-
-