org.springframework.beans.BeanWrapper
| Modifier and Type | Field and Description |
|---|---|
| protected final Log | |
| private final SortDefinition |
| Access | Constructor and Description |
|---|---|
| public | PropertyComparator(SortDefinition sortDefinition)
Create a new PropertyComparator for the given SortDefinition. |
| public | PropertyComparator(String
the property to compare property, boolean whether upper and lower case in String values should be ignored ignoreCase, boolean whether to sort ascending (true) or descending (false) ascending)Create a PropertyComparator for the given settings. |
| Modifier and Type | Method and Description |
|---|---|
| public int | compare(T
the first object to be compared. o1, T the second object to be compared. o2)Implements java. Compares its two arguments for order. |
| private Object | Returns: the property valuethe object to get the property value for obj)Get the SortDefinition's property value for the given object. |
| public final SortDefinition | |
| public static void | sort(List<?>
the input List source, SortDefinition the parameters to sort by sortDefinition)Sort the given List according to the given sort definition. |
| public static void | sort(Object[]
input source source, SortDefinition the parameters to sort by sortDefinition)Sort the given source according to the given sort definition. |
| logger | back to summary |
|---|---|
| protected final Log logger | |
| sortDefinition | back to summary |
|---|---|
| private final SortDefinition sortDefinition | |
| PropertyComparator | back to summary |
|---|---|
| public PropertyComparator(SortDefinition sortDefinition) Create a new PropertyComparator for the given SortDefinition.
| |
| PropertyComparator | back to summary |
|---|---|
| public PropertyComparator(String property, boolean ignoreCase, boolean ascending) Create a PropertyComparator for the given settings.
| |
| compare | back to summary |
|---|---|
| public int compare(T o1, T o2) Implements java. Doc from java. Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
The implementor must ensure that
The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| getPropertyValue | back to summary |
|---|---|
| private Object getPropertyValue(Object obj) Get the SortDefinition's property value for the given object. | |
| getSortDefinition | back to summary |
|---|---|
| public final SortDefinition getSortDefinition() Return the SortDefinition that this comparator uses. | |
| sort | back to summary |
|---|---|
| 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.
| |
| sort | back to summary |
|---|---|
| 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.
| |