|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.model.Model<T>
T - The type of the Model Objectpublic class Model<T extends java.io.Serializable>
Model is the basic implementation of an IModel. It just wraps a simple
model object. The model object must be serializable, as it is stored in the session. If you have
large objects to store, consider using LoadableDetachableModel
instead of this class.
| Constructor Summary | |
|---|---|
Model()
Construct the model without providing an object. |
|
Model(T object)
Construct the model, setting the given object as the wrapped object. |
|
| Method Summary | ||
|---|---|---|
void |
detach()
Detaches model after use. |
|
boolean |
equals(java.lang.Object obj)
|
|
T |
getObject()
Gets the model object. |
|
java.lang.Object |
getObject(Component component)
Deprecated. replace by IModel.getObject(). |
|
int |
hashCode()
|
|
static
|
of(java.util.Collection<? extends C> set)
Factory method for models that contain collections. |
|
static
|
of(java.util.List<? extends C> list)
Factory method for models that contain lists. |
|
static
|
of(java.util.Map<K,V> map)
Deprecated. use ofMap(Map) |
|
static
|
of(java.util.Set<? extends C> set)
Factory method for models that contain sets. |
|
static
|
of(T object)
Factory methods for Model which uses type inference to make code shorter. |
|
static
|
ofMap(java.util.Map<K,V> map)
Factory method for models that contain maps. |
|
void |
setObject(Component component,
java.lang.Object object)
Deprecated. replace by IModel.setObject(Object). |
|
void |
setObject(T object)
Set the model object; calls setObject(java.io.Serializable). |
|
java.lang.String |
toString()
|
|
static
|
valueOf(java.util.List<? extends C> list)
Deprecated. see of(List) |
|
static
|
valueOf(java.util.Map<K,V> map)
Deprecated. see of(Map) |
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Model()
public Model(T object)
object - The model object proper| Method Detail |
|---|
@Deprecated public static <K,V> IModel<java.util.Map<K,V>> valueOf(java.util.Map<K,V> map)
of(Map)
K - type of key inside mapV - type of value inside mapmap - The Map, which may or may not be Serializable
@Deprecated public static <C> IModel<java.util.List<? extends C>> valueOf(java.util.List<? extends C> list)
of(List)
C - type of object inside listlist - The List, which may or may not be Serializable
public static <C> IModel<java.util.List<? extends C>> of(java.util.List<? extends C> list)
list into a serializable one.
C - model typelist - The List, which may or may not be Serializable
@Deprecated public static <K,V> IModel<java.util.Map<K,V>> of(java.util.Map<K,V> map)
ofMap(Map)
map into a serializable one.
K - key type in mapV - value type in mapmap - The Map, which may or may not be Serializable
public static <K,V> IModel<java.util.Map<K,V>> ofMap(java.util.Map<K,V> map)
map into a serializable one.
K - key type in mapV - value type in mapmap - The Map, which may or may not be Serializable
public static <C> IModel<java.util.Set<? extends C>> of(java.util.Set<? extends C> set)
set into a serializable one.
C - model typeset - The Set, which may or may not be Serializable
public static <C> IModel<java.util.Collection<? extends C>> of(java.util.Collection<? extends C> set)
collection into a serializable ArrayList.
C - model typeset - The Collection, which may or may not be Serializable
public static <T extends java.io.Serializable> Model<T> of(T object)
new Model(object) .
T - object -
objectpublic T getObject()
IModel
getObject in interface IModel<T extends java.io.Serializable>IModel.getObject()public void setObject(T object)
setObject in interface IModel<T extends java.io.Serializable>object - the model objectIModel.setObject(Object)public void detach()
IDetachable
detach in interface IDetachableIDetachable.detach()public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()@Deprecated public final java.lang.Object getObject(Component component)
IModel.getObject().
component -
@Deprecated
public final void setObject(Component component,
java.lang.Object object)
IModel.setObject(Object).
component - object - public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||