Package org.apache.commons.jelly.xpath
Class XPathComparator
java.lang.Object
org.apache.commons.jelly.xpath.XPathComparator
- All Implemented Interfaces:
Comparator
Compares xml nodes by extracting the value at xpath and
comparing it.
- Version:
- $Id: XPathComparator.java 155420 2005-02-26 13:06:03Z dirkv $
- Author:
- Jason Horman
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classMy own runtime exception in case something goes wrong with sort. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintcompare(org.dom4j.Node n1, org.dom4j.Node n2) protected ComparablegetComparableValue(Object value) Turns the XPath result value into a Comparable object.org.jaxen.XPathgetXpath()voidsetDescending(boolean descending) voidsetXpath(org.jaxen.XPath xpath) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
XPathComparator
public XPathComparator() -
XPathComparator
public XPathComparator(org.jaxen.XPath xpath, boolean descending)
-
-
Method Details
-
setXpath
public void setXpath(org.jaxen.XPath xpath) -
getXpath
public org.jaxen.XPath getXpath() -
setDescending
public void setDescending(boolean descending) -
compare
- Specified by:
comparein interfaceComparator
-
compare
public int compare(org.dom4j.Node n1, org.dom4j.Node n2) -
getComparableValue
Turns the XPath result value into a Comparable object.
-