|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.faces.model.DataModel com.sun.jsfcl.data.CachedRowSetDataModel
CachedRowSetDataModel is a convenience implementation of
DataModel
that wraps a CachedRowSet
of Java objects.
Note that the specified CachedRowSet
MUST
be scrollable. In addition, if input components (that will be updating
model values) reference this object in value binding expressions, the
specified CachedRowSet
MUST be updatable.
Constructor Summary | |
CachedRowSetDataModel()
Construct a new CachedRowSetDataModel with no specified
wrapped data. |
|
CachedRowSetDataModel(javax.sql.rowset.CachedRowSet cachedRowSet)
Construct a new CachedRowSetDataModel wrapping the specified
CachedRowSet . |
Method Summary | |
javax.sql.rowset.CachedRowSet |
getCachedRowSet()
Return the CachedRowSet we are connected with,
if any; otherwise, return null . |
int |
getRowCount()
Return -1, since CachedRowSet does not provide a
standard way to determine the number of available rows without
scrolling through the entire CachedRowSet , and this can
be very expensive if the number of rows is large. |
java.lang.Object |
getRowData()
If row data is available, return a Map representing
the values of the columns for the row specified by rowIndex ,
keyed by the corresponding column names. |
int |
getRowIndex()
|
java.lang.Object |
getWrappedData()
|
boolean |
isRowAvailable()
Return true if there is wrappedData
available, and the result of calling absolute() on the
underlying CachedRowSet , passing the current value of
rowIndex plus one (to account for the fact that
CachedRowSet uses one-relative indexing), returns
true . |
void |
setCachedRowSet(javax.sql.rowset.CachedRowSet rowSet)
Set the CachedRowSet we are connected with,
or pass null to disconnect. |
void |
setRowIndex(int rowIndex)
|
void |
setWrappedData(java.lang.Object data)
|
Methods inherited from class javax.faces.model.DataModel |
addDataModelListener, getDataModelListeners, removeDataModelListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CachedRowSetDataModel()
Construct a new CachedRowSetDataModel
with no specified
wrapped data.
public CachedRowSetDataModel(javax.sql.rowset.CachedRowSet cachedRowSet)
Construct a new CachedRowSetDataModel
wrapping the specified
CachedRowSet
.
cachedRowSet
- CachedRowSet
to be wrapped (if any)Method Detail |
public boolean isRowAvailable()
Return true
if there is wrappedData
available, and the result of calling absolute()
on the
underlying CachedRowSet
, passing the current value of
rowIndex
plus one (to account for the fact that
CachedRowSet
uses one-relative indexing), returns
true
. Otherwise, return false
.
javax.faces.FacesException
- if an error occurs getting the row availabilitypublic int getRowCount()
Return -1, since CachedRowSet
does not provide a
standard way to determine the number of available rows without
scrolling through the entire CachedRowSet
, and this can
be very expensive if the number of rows is large.
javax.faces.FacesException
- if an error occurs getting the row countpublic java.lang.Object getRowData()
If row data is available, return a Map
representing
the values of the columns for the row specified by rowIndex
,
keyed by the corresponding column names. If no wrapped data is
available, return null
.
If a non-null
Map
is returned, its behavior
must correspond to the contract for a mutable Map
as
described in the JavaDocs for AbstractMap
, with the
following exceptions and specialized behavior:
Map
, and any supporting objects it returns,
must perform all column name comparisons in a
case-insensitive manner. This case-insensitivity must be
implemented using a case-insensitive Comparator
,
such as
String.CASE_INSENSITIVE_ORDER
.UnsupportedOperationException
: clear()
,
remove()
.entrySet()
method must return a Set
that has the following behavior:
UnsupportedOperationException
for any attempt
to add or remove entries from the Set
, either
directly or indirectly through an Iterator
returned by the Set
.value
of an entry in this
set
must write through to the corresponding
column value in the underlying CachedRowSet
.keySet()
method must return a Set
that throws UnsupportedOperationException
on any
attempt to add or remove keys, either directly or through an
Iterator
returned by the Set
.put()
method must throw
IllegalArgumentException
if a key value for which
containsKey()
returns false
is
specified. However, if a key already present in the Map
is specified, the specified value must write through to the
corresponding column value in the underlying CachedRowSet
.
values()
method must return a
Collection
that throws
UnsupportedOperationException
on any attempt to add
or remove values, either directly or through an Iterator
returned by the Collection
.
javax.faces.FacesException
- if an error occurs getting the row data
java.lang.IllegalArgumentException
- if now row data is available
at the currently specified row indexpublic int getRowIndex()
javax.faces.FacesException
public void setRowIndex(int rowIndex)
javax.faces.FacesException
java.lang.IllegalArgumentException
public java.lang.Object getWrappedData()
public void setWrappedData(java.lang.Object data)
java.lang.ClassCastException
public javax.sql.rowset.CachedRowSet getCachedRowSet()
Return the CachedRowSet
we are connected with,
if any; otherwise, return null
. This is a
type=safe alias for getWrappedData()
.
public void setCachedRowSet(javax.sql.rowset.CachedRowSet rowSet)
Set the CachedRowSet
we are connected with,
or pass null
to disconnect. This is a
type-safe alias for setWrappedData()
.
rowSet
- The CachedRowSet
we are connected to,
or null
to disconnect
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |