public final class ModelUtils extends Object
Modifier and Type | Method and Description |
---|---|
static int |
findLastIndex(RowKeyIndex table,
int startIndex,
int endIndex)
finds the last index in the given RowKeyIndex that has data and returns the
next index.
|
static int |
getRowCount(RowKeyIndex model)
finds the last index in the given RowKeyIndex that has data and returns the
next index.
|
static Iterator<Object> |
getRowKeyIterator(CollectionModel model)
Gets an iteration of all the rowKeys in a collection.
|
static CollectionModel |
toCollectionModel(Object value)
Converts an instance into a CollectionModel.
|
static javax.faces.model.DataModel |
toDataModel(Object value)
Converts an instance into a DataModel.
|
static MenuModel |
toMenuModel(Object value)
Converts an instance into a MenuModel
|
static TreeModel |
toTreeModel(Object value)
Converts an instance into a TreeModel
|
public static Iterator<Object> getRowKeyIterator(CollectionModel model)
public static int getRowCount(RowKeyIndex model)
RowKeyIndex.getRowCount()
of the
RowKeyIndex is not known.public static int findLastIndex(RowKeyIndex table, int startIndex, int endIndex)
RowKeyIndex.getRowCount()
of the
RowKeyIndex is not known.startIndex
- starts the search from this index. Use zero to start from
the beginning.endIndex
- the search will stop just before this index.public static CollectionModel toCollectionModel(Object value)
value
- This can be a DataModel, List, Array or other CollectionModel.public static javax.faces.model.DataModel toDataModel(Object value)
value
- Supported instances include java.util.List and
arrays.Copyright © 2001-2017 The Apache Software Foundation. All Rights Reserved.