com.iplanet.jato.model
Interface Model

All Known Subinterfaces:
ContextualModel, DatasetModel, DeleteQueryModel, DeletingModel, ExecutingModel, InsertingModel, InsertQueryModel, ModifyingQueryModel, QueryModel, RetrievingDatasetModel, RetrievingModel, SelectQueryModel, SQLModel, StoredProcModel, TreeModel, UpdateQueryModel, UpdatingModel
All Known Implementing Classes:
BeanAdapterModel, MultipleModelAdapter, ResourceBundleModel, SessionModel

public interface Model

A model is an abstraction of a value source. Models generally provide the source for values that are displayed by value-based views. Models can be backed by any number of implementations; however, users of a model need not be concerned about the implementation of the model as long as it supports this interface. This is the main power behind the model-view architecture presented in this package, that views can be bound to arbitrary models without specific knowledge of their implementation.

Version:
JATO/1.2.2 $Id: Model.java,v 1.7 2002/03/16 03:26:31 todd Exp $

Method Summary
 java.lang.String getName()
          Returns the logical instance name of this model.
 java.lang.Object getValue(java.lang.String name)
          Returns a named value from this model
 java.lang.Object[] getValues(java.lang.String name)
          Returns a named set of values from this model
 void setName(java.lang.String name)
          Sets the logical name of this model
 void setValue(java.lang.String name, java.lang.Object value)
          Sets a named value in this model.
 void setValues(java.lang.String name, java.lang.Object[] values)
          Sets a named set of values in this model
 

Method Detail

getName

public java.lang.String getName()
Returns the logical instance name of this model. This name can be any arbitrary string. This name may only be useful at certain times; for example, the ModelManager may assign a name to a model based on user request.
Returns:
The opaque, arbitrary name of this model

setName

public void setName(java.lang.String name)
Sets the logical name of this model
Parameters:
name - The new name of this model

getValue

public java.lang.Object getValue(java.lang.String name)
Returns a named value from this model
Parameters:
name - The name of the value to return
Returns:
The specified value. If the model has multiple values for the specified name, the first value is returned. If there is no value for the specified name, this method returns null.

setValue

public void setValue(java.lang.String name,
                     java.lang.Object value)
              throws ValidationException
Sets a named value in this model. This method overwrites any current value or values. If multiple values were present previously, they are all discarded.
Parameters:
name - The name of the value to set
value - The value to set in this model

getValues

public java.lang.Object[] getValues(java.lang.String name)
Returns a named set of values from this model
Parameters:
name - The name of the value set to return
Returns:
The specified set of values. If there is no value for the specified name, this method returns an array of zero length.

setValues

public void setValues(java.lang.String name,
                      java.lang.Object[] values)
               throws ValidationException
Sets a named set of values in this model
Parameters:
name - The name of the value set to set in the model
values - The set of values to set in this model