Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.xml.security.c14n.helper
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.Serializable

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).

Author:
  Christian Geuer-Pollmann
See Also:
  Serialized Form

Constructor Summary
`AttrCompare()`

Method Summary
`int` | `compare(org.w3c.dom.Attr attr0, org.w3c.dom.Attr attr1)` Compares two attributes based on the C14n specification.

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

### AttrCompare

    public AttrCompare()

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:
    `compare` in interface `java.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

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD