org.apache.myfaces.trinidad.model
Class RowKeyPropertyTreeModel

java.lang.Object
  extended by javax.faces.model.DataModel
      extended by org.apache.myfaces.trinidad.model.CollectionModel
          extended by org.apache.myfaces.trinidad.model.TreeModel
              extended by org.apache.myfaces.trinidad.model.ChildPropertyTreeModel
                  extended by org.apache.myfaces.trinidad.model.RowKeyPropertyTreeModel
All Implemented Interfaces:
Iterable, LocalRowKeyIndex, RowKeyIndex, TreeLocalRowKeyIndex

public class RowKeyPropertyTreeModel
extends ChildPropertyTreeModel

A subclass of ChildPropertyTreeModel that supports row keys by creating RowKeyPropertyModel(s) for its child models. Ooverrides the protected createChildModel method in ChildPropertyTreeModel so that it can instantiate RowKeyPropertyModels as it encounters child data.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.myfaces.trinidad.model.LocalRowKeyIndex
LocalRowKeyIndex.Confidence, LocalRowKeyIndex.LocalCachingStrategy
 
Constructor Summary
RowKeyPropertyTreeModel()
          No-arg constructor for use with managed-beans.
RowKeyPropertyTreeModel(Object model, String childProperty, String rowKeyProperty)
          Creates a RowKeyPropertyTreeModel
 
Method Summary
protected  CollectionModel createChildModel(Object childData)
          Overrides ChildPropertyTreeModel.createChildModel().
 String getRowKeyProperty()
          Gets the row key property name for this model
 void setRowKeyProperty(String rowKeyProperty)
          Sets the row key property for this model
 
Methods inherited from class org.apache.myfaces.trinidad.model.ChildPropertyTreeModel
enterContainer, exitContainer, getChildData, getChildProperty, getContainerRowKey, getRowCount, getRowData, getRowIndex, getRowKey, getSortCriteria, getWrappedData, isContainer, isRowAvailable, isSortable, setChildProperty, setRowIndex, setRowKey, setSortCriteria, setWrappedData
 
Methods inherited from class org.apache.myfaces.trinidad.model.TreeModel
areRowsLocallyAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, getAllAncestorContainerRowKeys, getContainerRowKey, getDepth, getDepth, isChildCollectionLocallyAvailable, isChildCollectionLocallyAvailable, isChildCollectionLocallyAvailable, isContainerEmpty
 
Methods inherited from class org.apache.myfaces.trinidad.model.CollectionModel
addRowKeyChangeListener, areRowsAvailable, areRowsAvailable, areRowsAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, clearCachedRow, clearCachedRow, clearCachedRows, clearCachedRows, clearLocalCache, fireRowKeyChange, getCachingStrategy, getEstimatedRowCount, getEstimatedRowCountConfidence, getRowData, getRowData, isRowAvailable, isRowAvailable, isRowLocallyAvailable, isRowLocallyAvailable, removeRowKeyChangeListener
 
Methods inherited from class javax.faces.model.DataModel
addDataModelListener, getDataModelListeners, iterator, removeDataModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowKeyPropertyTreeModel

public RowKeyPropertyTreeModel(Object model,
                               String childProperty,
                               String rowKeyProperty)
Creates a RowKeyPropertyTreeModel

Parameters:
model - The underlying model. This will be converted into a DataModel if necessary
childProperty - The property by which the child data can be accessed.
rowKeyProperty - The property by which the row key can be accessed.

RowKeyPropertyTreeModel

public RowKeyPropertyTreeModel()
No-arg constructor for use with managed-beans. Must call the ChildPropertyTreeModel.setChildProperty(java.lang.String), ChildPropertyTreeModel.setWrappedData(java.lang.Object) and setRowKeyProperty(java.lang.String) methods after constructing this instance.

Method Detail

createChildModel

protected CollectionModel createChildModel(Object childData)
Overrides ChildPropertyTreeModel.createChildModel(). Converts childData into a RowKeyPropertyModel.

Overrides:
createChildModel in class ChildPropertyTreeModel
Parameters:
childData - the data to convert. This can be a List or array.

getRowKeyProperty

public String getRowKeyProperty()
Gets the row key property name for this model

Returns:
row key property name

setRowKeyProperty

public void setRowKeyProperty(String rowKeyProperty)
Sets the row key property for this model

Parameters:
rowKeyProperty - row key property to set


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.