wicket.model
Class AbstractReadOnlyModel

java.lang.Object
  extended by wicket.model.AbstractModel
      extended by wicket.model.AbstractReadOnlyModel
All Implemented Interfaces:
java.io.Serializable, IDetachable, IModel
Direct Known Subclasses:
LoadableDetachableModel, ResourceModel, SelectedPathReplacementModel

public abstract class AbstractReadOnlyModel
extends AbstractModel

AbstractReadOnlyModel is an adapter base class for implementing models which have no detach logic and are read-only.

Author:
Igor Vaynberg ( ivaynberg )
See Also:
Serialized Form

Constructor Summary
AbstractReadOnlyModel()
           
 
Method Summary
abstract  java.lang.Object getObject(Component component)
          Gets the model object.
 void setObject(Component component, java.lang.Object object)
          This default implementation of setObject unconditionally throws an UnsupportedOperationException.
 java.lang.String toString()
           
 
Methods inherited from class wicket.model.AbstractModel
detach, getNestedModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractReadOnlyModel

public AbstractReadOnlyModel()
Method Detail

getObject

public abstract 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(Component)

setObject

public final void setObject(Component component,
                            java.lang.Object object)
This default implementation of setObject unconditionally throws an UnsupportedOperationException. Since the method is final, any subclass is effectively a read-only model.

Parameters:
component - The component wanting to set the object
object - The object to set into the model
Throws:
java.lang.UnsupportedOperationException

toString

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


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