|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ctc.wstx.util.PrefixedName
public final class PrefixedName
Simple key Object to be used for storing/accessing of potentially namespace scoped element and attribute names.
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 Summary | |
---|---|
PrefixedName(String prefix,
String localName)
|
Method Summary | |
---|---|
int |
compareTo(Object o)
|
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)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PrefixedName(String prefix, String localName)
Method Detail |
---|
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 String toString()
toString
in class Object
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public int compareTo(Object o)
compareTo
in interface Comparable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |