javax.faces.model
Class ResultSetDataModel

java.lang.Object
  extended by javax.faces.model.DataModel
      extended by javax.faces.model.ResultSetDataModel

public class ResultSetDataModel
extends DataModel

see Javadoc of JSF Specification

Version:
$Revision: 676298 $ $Date: 2008-07-13 05:31:48 -0500 (Sun, 13 Jul 2008) $
Author:
Thomas Spiegl (latest modification by $Author: skitching $), Martin Marinschek

Constructor Summary
ResultSetDataModel()
           
ResultSetDataModel(ResultSet resultSet)
           
 
Method Summary
 int getRowCount()
          We don't know how many rows the result set has without scrolling through the whole thing.
 Object getRowData()
          Get the actual data of this row wrapped into a map.
 int getRowIndex()
          Get the current row index.
 Object getWrappedData()
          Get the entire collection of data associated with this component.
 boolean isRowAvailable()
          Returns true if a call to getRowData will return a valid object.
 void setRowIndex(int rowIndex)
          Set the current row index.
 void setWrappedData(Object data)
          Set the entire list of data associated with this component.
 
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

ResultSetDataModel

public ResultSetDataModel()

ResultSetDataModel

public ResultSetDataModel(ResultSet resultSet)
Method Detail

getRowCount

public int getRowCount()
We don't know how many rows the result set has without scrolling through the whole thing.

Specified by:
getRowCount in class DataModel
Returns:
the number of rows available.

getRowData

public Object getRowData()
Get the actual data of this row wrapped into a map. The specification is very strict about what has to be returned from here, so check the spec before modifying anything here.

Specified by:
getRowData in class DataModel
Returns:
The object associated with the current row index.

getRowIndex

public int getRowIndex()
Description copied from class: DataModel
Get the current row index.

Specified by:
getRowIndex in class DataModel
Returns:
The current row index.

getWrappedData

public Object getWrappedData()
Description copied from class: DataModel
Get the entire collection of data associated with this component. Note that the actual type of the returned object depends upon the concrete subclass of DataModel; the object will represent an "ordered sequence of components", but may be implemented as an array, java.util.List, java.sql.ResultSet or other similar types.

Specified by:
getWrappedData in class DataModel
Returns:
the wrapped object.

isRowAvailable

public boolean isRowAvailable()
Description copied from class: DataModel
Returns true if a call to getRowData will return a valid object.

Specified by:
isRowAvailable in class DataModel
Returns:
true if a call to getRowData will return a valid object. false otherwise.

setRowIndex

public void setRowIndex(int rowIndex)
Description copied from class: DataModel
Set the current row index. This affects the behaviour of the getRowData method in particular.

Specified by:
setRowIndex in class DataModel
Parameters:
rowIndex - The row index. It may be -1 to indicate "no row", or may be a value between 0 and getRowCount()-1.

setWrappedData

public void setWrappedData(Object data)
Description copied from class: DataModel
Set the entire list of data associated with this component. Note that the actual type of the provided object must match the expectations of the concrete subclass of DataModel. See getWrappedData.

Specified by:
setWrappedData in class DataModel
Parameters:
data - The object to be wrapped.


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.