public final class PrefixedName extends Object implements Comparable<PrefixedName>
One important note about usage is that two of the name components (prefix and local name) HAVE to have been interned some way, as all comparisons are done using identity comparison; whereas URI is NOT necessarily interned.
Note that the main reason this class is mutable -- unlike most key classes -- is that this allows reusing key objects for access, as long as the code using it knows ramifications of trying to modify a key that's used in a data structure.
Note, too, that the hash code is cached as this class is mostly used as a Map key, and hash code is used a lot.
Constructor and Description |
---|
PrefixedName(String prefix,
String localName) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(PrefixedName other) |
boolean |
equals(Object o) |
String |
getLocalName() |
String |
getPrefix() |
int |
hashCode() |
boolean |
isaNsDeclaration() |
boolean |
isXmlReservedAttr(boolean nsAware,
String localName)
Method used to check for xml reserved attribute names, like
"xml:space" and "xml:id".
|
PrefixedName |
reset(String prefix,
String localName) |
String |
toString() |
static PrefixedName |
valueOf(QName n) |
public PrefixedName reset(String prefix, String localName)
public static PrefixedName valueOf(QName n)
public String getPrefix()
public String getLocalName()
public boolean isaNsDeclaration()
public boolean isXmlReservedAttr(boolean nsAware, String localName)
Note: it is assumed that the passed-in localName is also interned.
public int compareTo(PrefixedName other)
compareTo
in interface Comparable<PrefixedName>
Copyright © 2018 FasterXML. All rights reserved.