|
||||||||||
| 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()| Constructor Summary | |
|---|---|
CollectionModelDecorator()
|
|
| Method Summary | |
|---|---|
void |
addDataModelListener(javax.faces.model.DataModelListener listener)
|
protected abstract CollectionModel |
getCollectionModel()
This method returns the wrapped CollectionModel. |
javax.faces.model.DataModelListener[] |
getDataModelListeners()
|
int |
getRowCount()
Gets the number of values in this collection |
java.lang.Object |
getRowData()
Gets the current value identified by the current index or rowKey. |
java.lang.Object |
getRowData(int rowIndex)
Gets the rowData at the given index. |
int |
getRowIndex()
Gets the index of the current value. |
java.lang.Object |
getRowKey()
Gets the rowKey of the current row. |
java.util.List<SortCriterion> |
getSortCriteria()
Gets the criteria that this collection is sorted by. |
java.lang.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 |
isSortable(java.lang.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(java.lang.Object key)
Finds the row with the matching key and makes it current |
void |
setSortCriteria(java.util.List<SortCriterion> criteria)
Sorts this collection by the given criteria. |
void |
setWrappedData(java.lang.Object object)
|
| 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 java.lang.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(java.lang.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.
public java.lang.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.
public boolean isSortable(java.lang.String property)
CollectionModel
isSortable in class CollectionModelpublic java.util.List<SortCriterion> getSortCriteria()
CollectionModel
getSortCriteria in class CollectionModelSortCriterionpublic void setSortCriteria(java.util.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.SortCriterionpublic 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 java.lang.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 java.lang.Object getWrappedData()
getWrappedData in class javax.faces.model.DataModelpublic void setWrappedData(java.lang.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 | |||||||||