|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.clazzes.util.comparators.POJOComparatorFactory
public class POJOComparatorFactory
This factory contructs a comparator for a POJO class by parsing an expression.
Constructor Summary | |
---|---|
POJOComparatorFactory()
Contruct a POJOComparatorFactory using an instance of DefaultComparatorFactory . |
|
POJOComparatorFactory(ComparatorFactory comparatorFactory)
Contruct a POJOComparatorFactory using the given comparator factory for constructing value comparators. |
|
POJOComparatorFactory(java.util.Locale locale)
Contruct a POJOComparatorFactory using an instance of LocalizedComparatorFactory |
Method Summary | |
---|---|
java.util.Comparator |
getComparator(java.lang.Class clazz,
java.lang.String expression,
boolean ascending)
Construct a comparator for the given class by evaluating the specified chain of properties. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public POJOComparatorFactory()
DefaultComparatorFactory
.
comparatorFactory
- The factory, which constructs comparators for
individual property values.public POJOComparatorFactory(java.util.Locale locale)
LocalizedComparatorFactory
comparatorFactory
- The factory, which constructs comparators for
individual property values.public POJOComparatorFactory(ComparatorFactory comparatorFactory)
comparatorFactory
- The factory, which constructs comparators for
individual property values.Method Detail |
---|
public java.util.Comparator getComparator(java.lang.Class clazz, java.lang.String expression, boolean ascending) throws InvalidExpressionSyntaxException
clazz
- The class of the POJO object, which will be compared by the returned comparator.expression
- An expression, which represnets an OGNL-like chain of properties
like the following examples:
x.getMyProperty()
by y.getMyProperty()
.
x.getMyProperty().getAbc()
by y.getMyProperty().getAbc()
.
abc
,
def
and ghi
. The first property is the most significant.
prop.abc
,
prop.def
and gprop.hi
.
prop
.
abc
,
-def
and ghi
. The first property is the most significant.
ascending
- If false
, his parameter my be used to invert the sort oder
of the returned comparator.
InvalidExpressionSyntaxException
- If the syntax of the expression is invalid.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |