org.springframework.beans.support
Class PropertyComparator
- public class PropertyComparator
- implements Comparator
PropertyComparator performs a comparison of two beans,
using the specified bean property via a BeanWrapper.
- Author:
- Juergen Hoeller, Jean-Pierre Pawlak
- Since: 19.05.2003
Method Summary |
int | compare(Object o1, Object o2) |
static void | sort(List source, SortDefinition sortDefinition) Sorts the given List according to the given sort definition. |
static void | sort(Object[] source, SortDefinition sortDefinition) Sorts the given source according to the given sort definition. |
PropertyComparator
public PropertyComparator(SortDefinition sortDefinition)
compare
public int compare(Object o1, Object o2)
sort
public static void sort(List source, SortDefinition sortDefinition)
throws org.springframework.beans.BeansException
- Sorts the given List according to the given sort definition.
Note: Contained objects have to provide the given property
in the form of a bean property, i.e. a getXXX method.
- Parameters:
- source - the input List
- sortDefinition - the parameters to sort by
- Throws:
- java.lang.IllegalArgumentException - in case of a missing propertyName
sort
public static void sort(Object[] source, SortDefinition sortDefinition)
throws org.springframework.beans.BeansException
- Sorts the given source according to the given sort definition.
Note: Contained objects have to provide the given property
in the form of a bean property, i.e. a getXXX method.
- Parameters:
- source - input source
- sortDefinition - the parameters to sort by
- Throws:
- java.lang.IllegalArgumentException - in case of a missing propertyName
to Class org.springframework.beans.support.SortDefinition
to Class java.util.Map