Class AttrCompare
- java.lang.Object
-
- org.apache.xml.security.c14n.helper.AttrCompare
-
- All Implemented Interfaces:
java.io.Serializable,java.util.Comparator<org.w3c.dom.Attr>
public class AttrCompare extends java.lang.Object implements java.util.Comparator<org.w3c.dom.Attr>, java.io.SerializableCompares two attributes based on the C14n specification.- Namespace nodes have a lesser document order position than attribute nodes.
- An element's namespace nodes are sorted lexicographically by local name (the default namespace node, if one exists, has no local name and is therefore lexicographically least).
- An element's attribute nodes are sorted lexicographically with namespace URI as the primary key and local name as the secondary key (an empty namespace URI is lexicographically least).
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static intATTR0_BEFORE_ATTR1private static intATTR1_BEFORE_ATTR0private static longserialVersionUIDprivate static java.lang.StringXMLNS
-
Constructor Summary
Constructors Constructor Description AttrCompare()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(org.w3c.dom.Attr attr0, org.w3c.dom.Attr attr1)Compares two attributes based on the C14n specification.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
ATTR0_BEFORE_ATTR1
private static final int ATTR0_BEFORE_ATTR1
- See Also:
- Constant Field Values
-
ATTR1_BEFORE_ATTR0
private static final int ATTR1_BEFORE_ATTR0
- See Also:
- Constant Field Values
-
XMLNS
private static final java.lang.String XMLNS
- See Also:
- Constant Field Values
-
-
Method Detail
-
compare
public int compare(org.w3c.dom.Attr attr0, org.w3c.dom.Attr attr1)Compares two attributes based on the C14n specification.- Namespace nodes have a lesser document order position than attribute nodes.
- An element's namespace nodes are sorted lexicographically by local name (the default namespace node, if one exists, has no local name and is therefore lexicographically least).
- An element's attribute nodes are sorted lexicographically with namespace URI as the primary key and local name as the secondary key (an empty namespace URI is lexicographically least).
- Specified by:
comparein interfacejava.util.Comparator<org.w3c.dom.Attr>- Parameters:
attr0-attr1-- Returns:
- returns a negative integer, zero, or a positive integer as obj0 is less than, equal to, or greater than obj1
-
-