|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.clazzes.util.comparators.POJOFieldComparator
public class POJOFieldComparator
This comparator compares a POJO by the value of the supplied property.
Constructor Summary | |
---|---|
POJOFieldComparator(java.lang.Class clazz,
java.lang.String property,
java.util.Comparator fieldComparator)
Contructs a field comparator, which compare POJOs by the value of the given property name using the given Comparator. |
|
POJOFieldComparator(java.lang.Class clazz,
java.lang.String property,
ComparatorFactory comparatorFactory)
Contructs a field comparator, which comparea POJOs by the value of the given property name and the comparator constructed using the given ComparatorFactory. |
|
POJOFieldComparator(FieldAccessor fieldAccessor,
java.util.Comparator fieldComparator)
Contructs a field comparator, which uses the given accessor and Comparator. |
|
POJOFieldComparator(FieldAccessor fieldAccessor,
ComparatorFactory comparatorFactory)
Contructs a field comparator, which uses the given accessor and constructs the comparator for the field using the given ComparatorFactory. |
Method Summary | |
---|---|
int |
compare(java.lang.Object a,
java.lang.Object b)
|
FieldAccessor |
getFieldAccessor()
|
java.util.Comparator |
getFieldComparator()
|
void |
setFieldAccessor(FieldAccessor fieldAccessor)
|
void |
setFieldComparator(java.util.Comparator fieldComparator)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
---|
equals |
Constructor Detail |
---|
public POJOFieldComparator(FieldAccessor fieldAccessor, java.util.Comparator fieldComparator)
fieldAccessor
- The field accessor, which is used to fetch field values.fieldComparator
- The comparator, which compares field values.public POJOFieldComparator(FieldAccessor fieldAccessor, ComparatorFactory comparatorFactory)
fieldAccessor
- The field accessor, which is used to fetch field values.comparatorFactory
- The factory used to create a comparator base d on the type of the field.public POJOFieldComparator(java.lang.Class clazz, java.lang.String property, java.util.Comparator fieldComparator) throws java.lang.SecurityException, java.lang.NoSuchMethodException
clazz
- The POJO clazz.property
- The name of the POJO property, for which we use the getter function.fieldComparator
- The underlying comparator.
java.lang.SecurityException
- If the security comtext does not allow acces to the getter.
java.lang.NoSuchMethodException
- If the geter method does not exist.POJOFieldAccessor.POJOFieldAccessor(Class, String)
public POJOFieldComparator(java.lang.Class clazz, java.lang.String property, ComparatorFactory comparatorFactory) throws java.lang.SecurityException, java.lang.NoSuchMethodException
clazz
- The POJO clazz.property
- The name of the POJO property, for which we use the getter function.comparatorFactory
- The factory used to create a comparator base d on the type of the field.
java.lang.SecurityException
- If the security comtext does not allow acces to the getter.
java.lang.NoSuchMethodException
- If the geter method does not exist.POJOFieldAccessor.POJOFieldAccessor(Class, String)
Method Detail |
---|
public int compare(java.lang.Object a, java.lang.Object b)
compare
in interface java.util.Comparator
public FieldAccessor getFieldAccessor()
public void setFieldAccessor(FieldAccessor fieldAccessor)
fieldAccessor
- the fieldAccessor to setpublic java.util.Comparator getFieldComparator()
public void setFieldComparator(java.util.Comparator fieldComparator)
fieldComparator
- the fieldComparator to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |