Class NullDataSource
- java.lang.Object
-
- org.apache.tapestry5.internal.grid.NullDataSource
-
- All Implemented Interfaces:
GridDataSource
public class NullDataSource extends java.lang.Object implements GridDataSource
An implementation ofGridDataSourceused when the value null is provided as the source.
-
-
Constructor Summary
Constructors Constructor Description NullDataSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAvailableRows()Returns the number of rows available in the data source.java.lang.ClassgetRowType()Returns the type of value in the rows, or null if not known.java.lang.ObjectgetRowValue(int index)Returns the row value at the provided index.voidprepare(int startIndex, int endIndex, java.util.List<SortConstraint> sortConstraints)Invoked to allow the source to prepare to present values.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.tapestry5.grid.GridDataSource
getAvailableRows, isEmpty
-
-
-
-
Constructor Detail
-
NullDataSource
public NullDataSource()
-
-
Method Detail
-
getAvailableRows
public int getAvailableRows()
Description copied from interface:GridDataSourceReturns the number of rows available in the data source.- Specified by:
getAvailableRowsin interfaceGridDataSource
-
getRowType
public java.lang.Class getRowType()
Description copied from interface:GridDataSourceReturns the type of value in the rows, or null if not known. This value is used to create a defaultBeanModelwhen no such model is explicitly provided.- Specified by:
getRowTypein interfaceGridDataSource- Returns:
- the row type, or null
-
prepare
public void prepare(int startIndex, int endIndex, java.util.List<SortConstraint> sortConstraints)
Description copied from interface:GridDataSourceInvoked to allow the source to prepare to present values. This gives the source a chance to pre-fetch data (when appropriate) and informs the source of the desired sort order. Sorting comes first, then extraction by range.- Specified by:
preparein interfaceGridDataSource- Parameters:
startIndex- the starting index to be retrievedendIndex- the ending index to be retrievedsortConstraints- identify how data is to be sorted
-
getRowValue
public java.lang.Object getRowValue(int index)
Description copied from interface:GridDataSourceReturns the row value at the provided index. This method will be invoked in sequential order. In rare instances,GridDataSource.getAvailableRows()may return a different number of rows than are actually available (i.e., the database was changed between calls toGridDataSource.getAvailableRows()and the call toGridDataSource.prepare(int, int, java.util.List)). In that case, this method should return null for any out-of-range indexes.- Specified by:
getRowValuein interfaceGridDataSource
-
-