org.apache.myfaces.component.html.ext
Class SortableModel

java.lang.Object
  extended by javax.faces.model.DataModel
      extended by org.apache.myfaces.component.html.ext.SortableModel
All Implemented Interfaces:
javax.servlet.jsp.el.VariableResolver

public final class SortableModel
extends javax.faces.model.DataModel
implements javax.servlet.jsp.el.VariableResolver


Field Summary
static org.apache.commons.el.Logger LOGGER
           
protected static javax.servlet.jsp.el.FunctionMapper s_functionMapper
           
 
Constructor Summary
SortableModel()
          No arg constructor for use as a managed-bean.
SortableModel(java.lang.Object model)
          Create a new SortableModel from the given instance.
 
Method Summary
protected  java.lang.Object getPropertyValue(java.lang.String property)
           
 int getRowCount()
           
 java.lang.Object getRowData()
           
 int getRowIndex()
           
 java.util.List getSortCriteria()
           
 java.lang.Object getWrappedData()
           
 boolean isRowAvailable()
           
 boolean isSortable(java.lang.String property)
          Checks to see if the underlying collection is sortable by the given property.
 java.lang.Object resolveVariable(java.lang.String pName)
           
 void setRowIndex(int rowIndex)
           
 void setSortCriteria(java.util.List criteria)
           
 void setWrappedData(java.lang.Object data)
          Sets the underlying data being managed by this instance.
protected  javax.faces.model.DataModel toDataModel(java.lang.Object data)
           
 java.lang.String toString()
           
 
Methods inherited from class javax.faces.model.DataModel
addDataModelListener, getDataModelListeners, removeDataModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOGGER

public static final org.apache.commons.el.Logger LOGGER

s_functionMapper

protected static javax.servlet.jsp.el.FunctionMapper s_functionMapper
Constructor Detail

SortableModel

public SortableModel(java.lang.Object model)
Create a new SortableModel from the given instance.

Parameters:
model - This will be converted into a DataModel
See Also:
setWrappedData(java.lang.Object)

SortableModel

public SortableModel()
No arg constructor for use as a managed-bean. Must call setWrappedData before using this instance.

Method Detail

getRowData

public java.lang.Object getRowData()
Specified by:
getRowData in class javax.faces.model.DataModel

getWrappedData

public java.lang.Object getWrappedData()
Specified by:
getWrappedData in class javax.faces.model.DataModel

isRowAvailable

public boolean isRowAvailable()
Specified by:
isRowAvailable in class javax.faces.model.DataModel

setWrappedData

public void setWrappedData(java.lang.Object data)
Sets the underlying data being managed by this instance.

Specified by:
setWrappedData in class javax.faces.model.DataModel
Parameters:
data - This Object will be converted into a DataModel.

toDataModel

protected javax.faces.model.DataModel toDataModel(java.lang.Object data)

getRowCount

public int getRowCount()
Specified by:
getRowCount in class javax.faces.model.DataModel

setRowIndex

public void setRowIndex(int rowIndex)
Specified by:
setRowIndex in class javax.faces.model.DataModel

getRowIndex

public int getRowIndex()
Specified by:
getRowIndex in class javax.faces.model.DataModel

isSortable

public boolean isSortable(java.lang.String property)
Checks to see if the underlying collection is sortable by the given property.

Parameters:
property - The name of the property to sort the underlying collection by.
Returns:
true, if the property implements java.lang.Comparable

getSortCriteria

public java.util.List getSortCriteria()

setSortCriteria

public void setSortCriteria(java.util.List criteria)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getPropertyValue

protected java.lang.Object getPropertyValue(java.lang.String property)

resolveVariable

public java.lang.Object resolveVariable(java.lang.String pName)
                                 throws javax.servlet.jsp.el.ELException
Specified by:
resolveVariable in interface javax.servlet.jsp.el.VariableResolver
Throws:
javax.servlet.jsp.el.ELException


Copyright 2006 Apache Software Foundation. All Rights Reserved.