|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.faces.model.DataModel
org.apache.myfaces.trinidad.model.CollectionModel
org.apache.myfaces.trinidad.model.CollectionModelDecorator
public abstract class CollectionModelDecorator
Used by anybody who wants to wrap the CollectionModel class.
This class simply delegates all the CollectionModel functionalities to the wrapped class.
The wrapped CollectionModel is returned by thegetCollectionModel method. And that
method needs to be overriden by the subclasses.
getCollectionModel()| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.apache.myfaces.trinidad.model.LocalRowKeyIndex |
|---|
LocalRowKeyIndex.Confidence, LocalRowKeyIndex.LocalCachingStrategy |
| Constructor Summary | |
|---|---|
CollectionModelDecorator()
|
|
| Method Summary | |
|---|---|
void |
addDataModelListener(javax.faces.model.DataModelListener listener)
|
boolean |
areRowsAvailable(int rowCount)
Check if a range of rows is available starting from the current row. |
boolean |
areRowsAvailable(int startIndex,
int rowCount)
Check if a range of rows is available from a starting index. |
boolean |
areRowsAvailable(Object startRowKey,
int rowCount)
Check if a range of rows is available from a starting row key This method makes the row with the given row key current and calls #areRowsAvailable(rowsToCheck). |
boolean |
areRowsLocallyAvailable(int rowCount)
Check if a range of rows is locally available starting from current position. |
boolean |
areRowsLocallyAvailable(int startIndex,
int rowCount)
Check if a range of rows is locally available starting from a row index. |
boolean |
areRowsLocallyAvailable(Object startRowKey,
int rowCount)
Check if a range of rows is locally available starting from a row key. |
void |
clearCachedRow(int index)
Clear a row from the local cache by row index |
void |
clearCachedRow(Object rowKey)
Clear a row from the local cache by row key |
void |
clearCachedRows(int startingIndex,
int rowsToClear)
Clear the requested range of rows from the local cache |
void |
clearCachedRows(Object startingRowKey,
int rowsToClear)
Clear the requested range of rows from the local cache |
void |
clearLocalCache()
clear all rows from the local cache |
LocalRowKeyIndex.LocalCachingStrategy |
getCachingStrategy()
Indicates the caching strategy supported by the model |
protected abstract CollectionModel |
getCollectionModel()
This method returns the wrapped CollectionModel. |
javax.faces.model.DataModelListener[] |
getDataModelListeners()
|
int |
getEstimatedRowCount()
Convenient API to return a row count estimate. |
LocalRowKeyIndex.Confidence |
getEstimatedRowCountConfidence()
Helper API to determine if the row count returned from CollectionModel.getEstimatedRowCount()
is EXACT, or an ESTIMATE. |
int |
getRowCount()
Gets the number of values in this collection |
Object |
getRowData()
Gets the current value identified by the current index or rowKey. |
Object |
getRowData(int rowIndex)
Gets the rowData at the given index. |
Object |
getRowData(Object rowKey)
Returns the rowData for the given rowKey without changing model currency. |
int |
getRowIndex()
Gets the index of the current value. |
Object |
getRowKey()
Gets the rowKey of the current row. |
List<SortCriterion> |
getSortCriteria()
Gets the criteria that this collection is sorted by. |
Object |
getWrappedData()
|
boolean |
isRowAvailable()
Checks to make sure a value exists for the current index or rowKey. |
boolean |
isRowAvailable(int rowIndex)
Checks to see if the row at the given index is available. |
boolean |
isRowAvailable(Object rowKey)
Check for an available row by row key. |
boolean |
isRowLocallyAvailable(int rowIndex)
Given a row index, check if the row is locally available. |
boolean |
isRowLocallyAvailable(Object rowKey)
Given a row key, check if the row is locally available. |
boolean |
isSortable(String property)
Return true if this collection is sortable by the given property. |
void |
removeDataModelListener(javax.faces.model.DataModelListener listener)
|
void |
setRowIndex(int i)
Sets up a value at a particular index to be the current value. |
void |
setRowKey(Object key)
Finds the row with the matching key and makes it current |
void |
setSortCriteria(List<SortCriterion> criteria)
Sorts this collection by the given criteria. |
void |
setWrappedData(Object object)
|
| Methods inherited from class org.apache.myfaces.trinidad.model.CollectionModel |
|---|
addRowKeyChangeListener, fireRowKeyChange, removeRowKeyChangeListener |
| Methods inherited from class javax.faces.model.DataModel |
|---|
iterator |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CollectionModelDecorator()
| Method Detail |
|---|
public Object getRowKey()
CollectionModelObject.equals(java.lang.Object) and Object.hashCode() as they will be used
as keys in hashtables. rowKeys should also be Serializable, so that the
application can run under all JSF state-saving schemes.
getRowKey in interface RowKeyIndexgetRowKey in class CollectionModelCollectionModel.setRowKey(java.lang.Object)public void setRowKey(Object key)
CollectionModel
setRowKey in interface RowKeyIndexsetRowKey in class CollectionModelkey - the rowKey, previously obtained from CollectionModel.getRowKey().public boolean isRowAvailable(int rowIndex)
CollectionModelDataModel.isRowAvailable().
Finally, the row that was current before this method was called
is made current again.
isRowAvailable in interface RowKeyIndexisRowAvailable in class CollectionModelrowIndex - the index of the row to check.
DataModel.isRowAvailable()public boolean isRowAvailable(Object rowKey)
CollectionModelDataModel.isRowAvailable().
Finally, the row that was current before this method was called
is made current again.
isRowAvailable in interface RowKeyIndexisRowAvailable in class CollectionModelrowKey - the row key for the row to check.
DataModel.isRowAvailable()public Object getRowData(int rowIndex)
CollectionModelDataModel.getRowData().
Finally, the row that was current before this method was called
is made current again.
getRowData in interface RowKeyIndexgetRowData in class CollectionModelrowIndex - the index of the row to get data from.
DataModel.getRowData()public Object getRowData(Object rowKey)
CollectionModel
getRowData in interface RowKeyIndexgetRowData in class CollectionModelrowKey - the row key of the row to get data from.
DataModel.getRowData()public boolean isSortable(String property)
CollectionModel
isSortable in class CollectionModelpublic List<SortCriterion> getSortCriteria()
CollectionModel
getSortCriteria in class CollectionModelSortCriterionpublic void setSortCriteria(List<SortCriterion> criteria)
CollectionModel
setSortCriteria in class CollectionModelcriteria - Each element in this List must be of type SortCriterion.
The empty list may be used to cancel any sort order. null should be treated
the same as an empty list.SortCriterion
public boolean areRowsAvailable(int startIndex,
int rowCount)
CollectionModel
areRowsAvailable in interface RowKeyIndexareRowsAvailable in class CollectionModelstartIndex - the starting index for the rangerowCount - number of rows to check. If rowsToCheck < 0 set
startIndex = startIndex - abs(rowsToCheck) + 1. This
allows for checking for row availability from the end position. For example
to check for availability of n rows from the end, call
isRangeAvailable(getRowCount()-1, -n)
false
public boolean areRowsAvailable(Object startRowKey,
int rowCount)
CollectionModel#areRowsAvailable(rowsToCheck).
The current row does not change after this call
areRowsAvailable in interface RowKeyIndexareRowsAvailable in class CollectionModelstartRowKey - the starting row key for the rangerowCount - number of rows to check
CollectionModel.areRowsAvailable(int).public boolean areRowsAvailable(int rowCount)
CollectionModel
areRowsAvailable in interface RowKeyIndexareRowsAvailable in class CollectionModelrowCount - number of rows to check
public boolean areRowsLocallyAvailable(int startIndex,
int rowCount)
CollectionModel
areRowsLocallyAvailable in interface LocalRowKeyIndexareRowsLocallyAvailable in class CollectionModelstartIndex - starting row index to checkrowCount - number of rows to check
falseCollectionModel.areRowsAvailable(int, int)
public boolean areRowsLocallyAvailable(Object startRowKey,
int rowCount)
CollectionModel
areRowsLocallyAvailable in interface LocalRowKeyIndexareRowsLocallyAvailable in class CollectionModelstartRowKey - starting row key to checkrowCount - number of rows to check
falseCollectionModel.areRowsAvailable(Object, int)public boolean areRowsLocallyAvailable(int rowCount)
CollectionModelareRowsLocallyAvailable(startIndex, rowsToCheck)
areRowsLocallyAvailable in interface LocalRowKeyIndexareRowsLocallyAvailable in class CollectionModelrowCount - number of rows to check
falseareRowsLocallyAvailable(startIndex, rowsToCheck)public boolean isRowLocallyAvailable(int rowIndex)
CollectionModel
isRowLocallyAvailable in interface LocalRowKeyIndexisRowLocallyAvailable in class CollectionModelrowIndex - row index to check
falsepublic boolean isRowLocallyAvailable(Object rowKey)
CollectionModel
isRowLocallyAvailable in interface LocalRowKeyIndexisRowLocallyAvailable in class CollectionModelrowKey - row key to check
falsepublic int getEstimatedRowCount()
CollectionModel
getEstimatedRowCount in interface LocalRowKeyIndexgetEstimatedRowCount in class CollectionModelDataModel.getRowCount()public LocalRowKeyIndex.Confidence getEstimatedRowCountConfidence()
CollectionModelCollectionModel.getEstimatedRowCount()
is EXACT, or an ESTIMATE.
getEstimatedRowCountConfidence in interface LocalRowKeyIndexgetEstimatedRowCountConfidence in class CollectionModelDataModel.getRowCount()public void clearLocalCache()
clearLocalCache in interface LocalRowKeyIndexclearLocalCache in class CollectionModel
public void clearCachedRows(int startingIndex,
int rowsToClear)
clearCachedRows in interface LocalRowKeyIndexclearCachedRows in class CollectionModelstartingIndex - starting row index for the range to clearrowsToClear - number of rows to clear from the cacheCollectionModel.clearLocalCache()
public void clearCachedRows(Object startingRowKey,
int rowsToClear)
clearCachedRows in interface LocalRowKeyIndexclearCachedRows in class CollectionModelstartingRowKey - starting row key for the range to clearrowsToClear - number of rows to clear from the cacheCollectionModel.clearLocalCache()public void clearCachedRow(int index)
clearCachedRow in interface LocalRowKeyIndexclearCachedRow in class CollectionModelindex - row index for the row to clear from the cacheCollectionModel.clearCachedRows(int, int)public void clearCachedRow(Object rowKey)
clearCachedRow in interface LocalRowKeyIndexclearCachedRow in class CollectionModelrowKey - row key for the row to clear from the cacheCollectionModel.clearCachedRows(Object, int)public LocalRowKeyIndex.LocalCachingStrategy getCachingStrategy()
getCachingStrategy in interface LocalRowKeyIndexgetCachingStrategy in class CollectionModelLocalCachingStrategypublic boolean isRowAvailable()
RowKeyIndexRowKeyIndex.getRowCount()).
isRowAvailable in interface RowKeyIndexisRowAvailable in class javax.faces.model.DataModelRowKeyIndex.getRowKey(),
RowKeyIndex.getRowIndex()public int getRowCount()
RowKeyIndex
getRowCount in interface RowKeyIndexgetRowCount in class javax.faces.model.DataModelpublic Object getRowData()
RowKeyIndex
getRowData in interface RowKeyIndexgetRowData in class javax.faces.model.DataModelRowKeyIndex.getRowKey(),
RowKeyIndex.getRowIndex()public int getRowIndex()
RowKeyIndex
getRowIndex in interface RowKeyIndexgetRowIndex in class javax.faces.model.DataModelpublic void setRowIndex(int i)
RowKeyIndex
setRowIndex in interface RowKeyIndexsetRowIndex in class javax.faces.model.DataModeli - the zero-based index of the value to make current.
Use -1 to clear the current valuepublic Object getWrappedData()
getWrappedData in class javax.faces.model.DataModelpublic void setWrappedData(Object object)
setWrappedData in class javax.faces.model.DataModelpublic void addDataModelListener(javax.faces.model.DataModelListener listener)
addDataModelListener in class javax.faces.model.DataModelpublic javax.faces.model.DataModelListener[] getDataModelListeners()
getDataModelListeners in class javax.faces.model.DataModelpublic void removeDataModelListener(javax.faces.model.DataModelListener listener)
removeDataModelListener in class javax.faces.model.DataModelprotected abstract CollectionModel getCollectionModel()
CollectionModel.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||