|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.trinidad.model.ModelUtils
public final class ModelUtils
Provides convenience methods for converting objects into models, and working with models.
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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 TreeModel toTreeModel(Object value)
public static MenuModel toMenuModel(Object value)
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |