Interface NodeName
- 
- All Superinterfaces:
- IdentityComparable
 - All Known Implementing Classes:
- CodedName,- FingerprintedQName,- NameOfNode,- NoNamespaceName
 
 public interface NodeName extends IdentityComparable This interface represents a node name. Actually it represents any QName, but it is intended for use as an element or attribute name. Various implementations are available.An important requirement of an implementation of this interface is that the hashCode() and equals() methods are implemented correctly, so that any two node names compare equal if and only if the local name and namespace URI parts are equal under Unicode codepoint comparison. To ensure this, the hashCode must be computed using an algorithm equivalent to that used by the implementation class FingerprintedQNameThis class is used to carry name information for elements and attributes on the Receiver pipeline. An advantage of this is that NodeName can include a fingerprint where this is available, but the fingerprint does not need to be computed if it is not needed. For example, names of nodes constructed by an XSLT stylesheet and sent down an output pipeline to a Serializer will generally not have fingerprints. Equality comparisons between NodeNames work reasonably well: the comparison can use the fingerprints if available, or the QNames otherwise. However, computing hashCodes is inefficient; it is not possible to take advantage of the fingerprints, because they are not always there. Therefore, using NodeName objects in structures such as maps and sets is generally a bad idea: it's better to use either the StructuredQName or the fingerprint as the key. 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetDisplayName()Get the display name, that is the lexical QName in the form [prefix:]local-partintgetFingerprint()Get the fingerprint of this name if known.java.lang.StringgetLocalPart()Get the local part of the QNameNamespaceBindinggetNamespaceBinding()Get aNamespaceBindingwhose (prefix, uri) pair are the prefix and URI of this node namejava.lang.StringgetPrefix()Get the prefix of the QName.StructuredQNamegetStructuredQName()Get the name in the form of a StructuredQNamejava.lang.StringgetURI()Get the namespace URI of the QName.booleanhasFingerprint()Ask whether this node name representation has a known fingerprintbooleanhasURI(java.lang.String ns)Test whether this name is in a given namespaceintobtainFingerprint(NamePool namePool)Get the fingerprint of this name, allocating a new code from the namepool if necessary- 
Methods inherited from interface net.sf.saxon.om.IdentityComparableidentityHashCode, isIdentical
 
- 
 
- 
- 
- 
Method Detail- 
getPrefixjava.lang.String getPrefix() Get the prefix of the QName.- Returns:
- the prefix. Returns the empty string if the name is unprefixed.
 
 - 
getURIjava.lang.String getURI() Get the namespace URI of the QName.- Returns:
- the URI. Returns the empty string to represent the no-namespace
 
 - 
getLocalPartjava.lang.String getLocalPart() Get the local part of the QName- Returns:
- the local part of the QName
 
 - 
getDisplayNamejava.lang.String getDisplayName() Get the display name, that is the lexical QName in the form [prefix:]local-part- Returns:
- the lexical QName
 
 - 
getStructuredQNameStructuredQName getStructuredQName() Get the name in the form of a StructuredQName- Returns:
- the name in the form of a StructuredQName
 
 - 
hasURIboolean hasURI(java.lang.String ns) Test whether this name is in a given namespace- Parameters:
- ns- the namespace to be tested against
- Returns:
- true if the name is in the specified namespace
 
 - 
getNamespaceBindingNamespaceBinding getNamespaceBinding() Get aNamespaceBindingwhose (prefix, uri) pair are the prefix and URI of this node name- Returns:
- the corresponding NamespaceBinding
 
 - 
hasFingerprintboolean hasFingerprint() Ask whether this node name representation has a known fingerprint- Returns:
- true if the method getFingerprint() will return a result other than -1
 
 - 
getFingerprintint getFingerprint() Get the fingerprint of this name if known. This method should not do any work to allocate a fingerprint if none is already available- Returns:
- the fingerprint if known; otherwise -1
 
 - 
obtainFingerprintint obtainFingerprint(NamePool namePool) Get the fingerprint of this name, allocating a new code from the namepool if necessary- Parameters:
- namePool- the NamePool used to allocate the name
- Returns:
- a fingerprint for this name, newly allocated if necessary
 
 
- 
 
-