DataModel is an abstraction around arbitrary data binding technologies that can be used to adapt a variety of data sources for use by JavaServer Faces components that support per-row processing for their child components (such as {@link UIData}.
The data collection underlying a {@link DataModel} instance ismodeled as a collection of row objects that can be accessed by a zero-relative cursor (row index). The APIs provide mechanisms to position to a specified zero-relative row index, and to retrieve an object that represents the data that corresponds to the current row index.
A concrete {@link DataModel} instance is attached to a particularcollection of underlying data by calling the setWrappedData()
method. It can be detached from that underlying data collection by passing a null
parameter to this method.
Concrete {@link DataModel} implementations must provide a publiczero-arguments constructor that calls setWrappedData(null)
. A convenience constructor that takes a wrapped object of the appropriate type (and passes it on via a call to setWrappedData()
, should also be provided.
Event listeners may be registered to receive notifications of when a new row index is selected.
Implementations represent a repository of information about users and their associated {@link Preference}s for items.
Abstract model interface for representing a record of named data fields. The map provides a uniform API for accessing data which may be contained in a variety of data model constructs underneath, such as RowSet, DefaultTableModelExt, or arbitrary JavaBean classes. The user-interface Binding classes use this interface to "bind" user-interface components to field elements in a data model without having to understand the specific flavor of data model being used by the application. For example, a field element may map to a named column on a RowSet or a property on a JavaBean, but the binding classes don't need to understand those underlying data structures in order to read and write values.
For each named field, the data model provides access to:
Often data models are collections of like-objects, such as the rows in a RowSet, or a list of JavaBeans. This interface provides a mechanism to index into such a collection such that at any given time, the data model contains the element values associated with the "current" record index into that collection (the current row, or the current bean, etc).
@author Amy Fowler @version 1.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|