wicket.model
Class Model

java.lang.Object
  extended bywicket.model.AbstractModel
      extended bywicket.model.Model
All Implemented Interfaces:
IDetachable, IModel, java.io.Serializable

public class Model
extends AbstractModel

Model is the basic implementation of an AbstractModel. 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 AbstractDetachableModelinstead of this class.

Author:
Chris Turner, Eelco Hillenius
See Also:
Serialized Form

Constructor Summary
Model()
          Construct the model without providing an object.
Model(java.io.Serializable object)
          Construct the model, setting the given object as the wrapped object.
 
Method Summary
 IModel getNestedModel()
          Gets the nested model.
 java.lang.Object getObject(Component component)
          Gets the model object.
 void setObject(Component component, java.lang.Object object)
          Set the model object; calls setObject(java.io.Serializable).
 void setObject(java.io.Serializable object)
          Sets the model object.
static Model valueOf(java.util.List list)
           
static Model valueOf(java.util.Map map)
           
 
Methods inherited from class wicket.model.AbstractModel
detach
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Model

public Model()
Construct the model without providing an object.


Model

public Model(java.io.Serializable object)
Construct the model, setting the given object as the wrapped object.

Parameters:
object - The model object proper
Method Detail

valueOf

public static Model valueOf(java.util.Map map)
Parameters:
map - The Map, which may or may not be Serializable
Returns:
A Model object wrapping the Map

valueOf

public static Model valueOf(java.util.List list)
Parameters:
list - The List, which may or may not be Serializable
Returns:
A Model object wrapping the List

getNestedModel

public IModel getNestedModel()
Description copied from interface: IModel
Gets the nested model.

Returns:
The nested model object.
See Also:
IModel.getNestedModel()

getObject

public java.lang.Object getObject(Component component)
Description copied from interface: IModel
Gets the model object.

Parameters:
component - The component which wants to get a model Object
Returns:
The model object
See Also:
IModel.getObject(wicket.Component)

setObject

public void setObject(Component component,
                      java.lang.Object object)
Set the model object; calls setObject(java.io.Serializable). The model object must be serializable, as it is stored in the session

Parameters:
object - the model object
component - The component which wants to set a new model Object
See Also:
IModel.setObject(Component, Object)

setObject

public void setObject(java.io.Serializable object)
Sets the model object. The model object must be serializable, as it is stored in the session

Parameters:
object - The serializable model object
See Also:
IModel.setObject(Component, Object)


Copyright © 2004-2005 Wicket developers. All Rights Reserved.