protected class CanonicalXMLSerializerImpl.AttributeComparator
extends java.lang.Object
implements java.util.Comparator
Comparator interface for DOM attributes.
The namespace of the attribute is used as the primary key. A namespace uri equalling null is lexicographically least. If the primary keys are equal for two attributes, the local name of each attribute is used as the secondary key.
PLEASE NOTE: The ordering imposed by thisComparator implementation is NOT consistent
with equals!Comparator| Modifier | Constructor and Description |
|---|---|
protected |
AttributeComparator() |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(java.lang.Object o1,
java.lang.Object o2) |
protected java.lang.String |
getPrimaryKey(org.w3c.dom.Attr attribute)
Provides the primary key for the specified attribute.
|
protected java.lang.String |
resolvePrefix(org.w3c.dom.Attr attribute)
Provides the namespace URI bound to the specified attribute's namespace prefix.
|
public int compare(java.lang.Object o1,
java.lang.Object o2)
compare in interface java.util.ComparatorComparator.compare(T, T)protected java.lang.String resolvePrefix(org.w3c.dom.Attr attribute)
attribute - The attribute, which namespace prefix should be resolved.protected java.lang.String getPrimaryKey(org.w3c.dom.Attr attribute)
attribute - The attribute, which primary key should be provided.null, if the attribute has no namespace prefix.