Skip navigation links

Oracle Fusion Middleware XML Security Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10680-04


oracle.security.xmlsec.util
Class DocOrderComparator

java.lang.Object
  extended by oracle.security.xmlsec.util.DocOrderComparator

All Implemented Interfaces:
java.util.Comparator

public class DocOrderComparator
extends java.lang.Object
implements java.util.Comparator

Comparator for sorting nodes into document order as defined by XPath 1.0, and extended for attributes and namespaces by Canonical XML 1.0.

Since:
2.0

Constructor Summary
DocOrderComparator()
          Creates a new DocOrderComparator.

 

Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compares the two given nodes' document order.
static int compareNodes(org.w3c.dom.Node n1, org.w3c.dom.Node n2)
           
 boolean equals(java.lang.Object obj)
           

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

DocOrderComparator

public DocOrderComparator()
Creates a new DocOrderComparator.

Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Compares the two given nodes' document order.
Specified by:
compare in interface java.util.Comparator
Parameters:
o1 - The first Node to compare.
o2 - The second Node to compare.
Returns:
-1 if o1 precedes o2 in document order; returns 0 if they have the same document order; returns 1 if o2 precedes o1.
Throws:
java.lang.ClassCastException - If either o1 or o2 is not an instance of org.w3c.dom.Node.
java.lang.IllegalArgumentException - If the two nodes cannot legitimately be compared for document order (e.g., they are not in the same document).

equals

public boolean equals(java.lang.Object obj)
Specified by:
equals in interface java.util.Comparator
Overrides:
equals in class java.lang.Object

compareNodes

public static int compareNodes(org.w3c.dom.Node n1,
                               org.w3c.dom.Node n2)
                        throws XPathException
Throws:
XPathException

Skip navigation links

Oracle Fusion Middleware XML Security Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10680-04


Copyright © 2005, 2011 , Oracle. All rights reserved.