java.io.Serializable
public class StructuredQName
extends java.lang.Object
implements java.io.Serializable
Instances of this class are immutable.
Constructor | Description |
---|---|
StructuredQName(java.lang.String prefix,
java.lang.String uri,
java.lang.String localName) |
Construct a StructuredQName from a prefix, URI, and local name.
|
StructuredQName(NamePool pool,
int nameCode) |
Make a structuredQName from a Namepool nameCode
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(java.lang.Object other) |
Compare two StructuredQName values for equality.
|
static StructuredQName |
fromClarkName(java.lang.String expandedName) |
Make a structuredQName from a Clark name
|
static StructuredQName |
fromLexicalQName(java.lang.CharSequence lexicalName,
boolean useDefault,
NameChecker checker,
NamespaceResolver resolver) |
Make a structured QName from a lexical QName, using a supplied NamespaceResolver to
resolve the prefix
|
java.lang.String |
getClarkName() |
Get the expanded QName in Clark format, that is "{uri}local" if it is in a namespace, or just "local"
otherwise.
|
java.lang.String |
getDisplayName() |
Get the display name, that is the lexical QName in the form [prefix:]local-part
|
java.lang.String |
getLocalName() |
Get the local part of the QName
|
java.lang.String |
getNamespaceURI() |
Get the namespace URI of the QName.
|
java.lang.String |
getPrefix() |
Get the prefix of the QName.
|
int |
hashCode() |
Get a hashcode to reflect the equals() method
|
java.lang.Object |
makeQName(Configuration config) |
Temporary method to construct a javax.xml.namespace.QName without actually mentioning it
by name (because the class is not available in JDK 1.4)
|
java.lang.String |
toString() |
The toString() method displays the QName as a lexical QName, that is prefix:local
|
public StructuredQName(java.lang.String prefix, java.lang.String uri, java.lang.String localName)
prefix
- The prefix. Use an empty string to represent the null prefix.uri
- The namespace URI. Use an empty string or null to represent the no-namespacelocalName
- The local part of the namepublic StructuredQName(NamePool pool, int nameCode)
pool
- the NamePoolnameCode
- a name code that has been registered in the NamePoolpublic static StructuredQName fromClarkName(java.lang.String expandedName)
expandedName
- the name in Clark notation "{uri}local" if in a namespace, or "local" otherwise.
The format "{}local" is also accepted for a name in no namespace.java.lang.IllegalArgumentException
- if the Clark name is malformedpublic static StructuredQName fromLexicalQName(java.lang.CharSequence lexicalName, boolean useDefault, NameChecker checker, NamespaceResolver resolver) throws XPathException
lexicalName
- the QName as a lexical name (prefix:local)useDefault
- set to true if an absent prefix implies use of the default namespace;
set to false if an absent prefix implies no namespacechecker
- NameChecker to be used to check conformance against XML 1.0 or 1.1 lexical rulesresolver
- NamespaceResolver used to look up a URI for the prefixXPathException
- if the namespace prefix is not in scope or if the value is lexically
invalid. Error code FONS0004 is set if the namespace prefix has not been declared; error
code FOCA0002 is set if the name is lexically invalid.public java.lang.String getPrefix()
public java.lang.String getNamespaceURI()
public java.lang.String getLocalName()
public java.lang.String getDisplayName()
public java.lang.String getClarkName()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object makeQName(Configuration config)
config
- the Saxon configuration