org.springframework.beans.support
Class PropertyComparator
java.lang.Object
org.springframework.beans.support.PropertyComparator
- All Implemented Interfaces:
- Comparator
- public class PropertyComparator
- extends Object
- implements Comparator
PropertyComparator performs a comparison of two beans,
using the specified bean property via a BeanWrapper.
- Since:
- 19.05.2003
- Author:
- Juergen Hoeller, Jean-Pierre Pawlak
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected final Log logger
PropertyComparator
public PropertyComparator(SortDefinition sortDefinition)
compare
public int compare(Object o1,
Object o2)
- Specified by:
compare
in interface Comparator
sort
public static void sort(List source,
SortDefinition sortDefinition)
throws BeansException
- Sort 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 ListsortDefinition
- the parameters to sort by
- Throws:
IllegalArgumentException
- in case of a missing propertyName
BeansException
sort
public static void sort(Object[] source,
SortDefinition sortDefinition)
throws BeansException
- Sort 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 sourcesortDefinition
- the parameters to sort by
- Throws:
IllegalArgumentException
- in case of a missing propertyName
BeansException
Copyright (C) 2003-2004 The Spring Framework Project.