org.xfp.filters.beans
Class BeanCollectionSorter
java.lang.Object
org.xfp.AttributeContainer
org.xfp.Filter
org.xfp.filters.beans.BeanCollectionSorter
- public class BeanCollectionSorter
- extends Filter
Sorts a Collection of JavaBeans using the value of the specified property.
- Version:
- $Id: BeanCollectionSorter.java,v 1.1 2004/03/19 15:56:46 flaviotordini Exp $
- Author:
- Flavio Tordini
- See Also:
BeanComparator,
Collections.sort(List, Comparator)- JAR Dependency:
- Jakarta Commons BeanUtils
|
Method Summary |
java.util.List |
execute(java.util.Collection collection)
Executes this filter. |
void |
reset()
Resets filter status after execution. |
void |
setProperty(java.lang.String property)
Sets the bean property used to sort the Collection. |
void |
setReverse(boolean reverse)
If true, imposes the reverse of the natural ordering. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
BeanCollectionSorter
public BeanCollectionSorter()
execute
public java.util.List execute(java.util.Collection collection)
throws java.lang.Exception
- Executes this filter.
- Returns:
- A sorted List.
- Throws:
java.lang.Exception
reset
public void reset()
- Description copied from class:
Filter
- Resets filter status after execution. This method is called after
execute(), even in case of exceptions. Since a Filter instance may be
reused (and actually is), you must use this method to reset all your
class members to their default value.
- Specified by:
reset in class Filter
- See Also:
Filter.reset()
setReverse
public void setReverse(boolean reverse)
- If true, imposes the reverse of the natural ordering.
- Parameters:
reverse - A boolean specifying wheter to reverse the natural ordering.- Property default value:
- false
setProperty
public void setProperty(java.lang.String property)
- Sets the bean property used to sort the Collection.
- Parameters:
property - String method name to call to compare- Property is required.
Copyright © 2003-2004 XFP Team. All Rights Reserved.