org.apache.wicket.model
Class CompoundPropertyModel

java.lang.Object
  extended by org.apache.wicket.model.CompoundPropertyModel
All Implemented Interfaces:
java.io.Serializable, IClusterable, IChainingModel, IComponentInheritedModel, IDetachable, IModel
Direct Known Subclasses:
BoundCompoundPropertyModel

public class CompoundPropertyModel
extends java.lang.Object
implements IComponentInheritedModel, IChainingModel

A simple compound model which uses the component's name as the property expression to retrieve properties on the nested model object. CompoundPropertyModel is a chaining model so it will call get/setobject on the given object if the object is an instanceof IModel itself.

Author:
Jonathan Locke
See Also:
IModel, Model, LoadableDetachableModel, IChainingModel, Serialized Form

Constructor Summary
CompoundPropertyModel(java.lang.Object object)
          Constructor
 
Method Summary
 IModel bind(java.lang.String property)
          Binds this model to a special property by returning a model that has this compound model as its nested/wrapped model and the property which should be evaluated.
 void detach()
          Detaches model after use.
 IModel getChainedModel()
          Returns the chained model if there is a chained model.
 java.lang.Object getObject()
          Gets the model object.
 java.lang.Object getObject(Component component)
          Deprecated. replace by IModel.getObject().
protected  java.lang.String propertyExpression(Component component)
          Returns the property expression that should be used against the target object
 void setChainedModel(IModel model)
          Sets the model that is chained inside this model.
 void setObject(Component component, java.lang.Object object)
          Deprecated. replace by IModel.setObject(Object).
 void setObject(java.lang.Object object)
          Sets the model object.
 java.lang.String toString()
           
 IWrapModel wrapOnInheritance(Component component)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompoundPropertyModel

public CompoundPropertyModel(java.lang.Object object)
Constructor

Parameters:
object - The model object, which may or may not implement IModel
Method Detail

getObject

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

Specified by:
getObject in interface IModel
Returns:
The model object
See Also:
IModel.getObject()

setObject

public void setObject(java.lang.Object object)
Description copied from interface: IModel
Sets the model object.

Specified by:
setObject in interface IModel
Parameters:
object - The model object
See Also:
IModel.setObject(java.lang.Object)

getChainedModel

public IModel getChainedModel()
Description copied from interface: IChainingModel
Returns the chained model if there is a chained model.

Specified by:
getChainedModel in interface IChainingModel
Returns:
The chained model
See Also:
IChainingModel.getChainedModel()

setChainedModel

public void setChainedModel(IModel model)
Description copied from interface: IChainingModel
Sets the model that is chained inside this model.

Specified by:
setChainedModel in interface IChainingModel
See Also:
IChainingModel.setChainedModel(org.apache.wicket.model.IModel)

detach

public void detach()
Description copied from interface: IDetachable
Detaches model after use. This is generally used to null out transient references that can be re-attached later.

Specified by:
detach in interface IDetachable
See Also:
IDetachable.detach()

propertyExpression

protected java.lang.String propertyExpression(Component component)
Returns the property expression that should be used against the target object

Parameters:
component -
Returns:
property expression that should be used against the target object

wrapOnInheritance

public IWrapModel wrapOnInheritance(Component component)
Specified by:
wrapOnInheritance in interface IComponentInheritedModel
Returns:
The WrapModel that wraps this model
See Also:
IComponentInheritedModel.wrapOnInheritance(org.apache.wicket.Component)

bind

public IModel bind(java.lang.String property)
Binds this model to a special property by returning a model that has this compound model as its nested/wrapped model and the property which should be evaluated. This can be used if the id of the Component isn't a valid property for the data object.

Parameters:
property -
Returns:
The IModel that is a wrapper around the current model and the property

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getObject

public final java.lang.Object getObject(Component component)
Deprecated. replace by IModel.getObject().

Parameters:
component -
Returns:

setObject

public final void setObject(Component component,
                            java.lang.Object object)
Deprecated. replace by IModel.setObject(Object).

Parameters:
component -
object -


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.