|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.om.StructuredQName
public class StructuredQName
This class provides an economical representation of a QName triple (prefix, URI, and localname). The value is stored internally as a character array containing the concatenation of URI, localname, and prefix (in that order) with two integers giving the start positions of the localname and prefix.
Instances of this class are immutable.
Constructor Summary | |
---|---|
StructuredQName(NamePool pool,
int nameCode)
Make a structuredQName from a Namepool nameCode |
|
StructuredQName(String prefix,
String uri,
String localName)
Construct a StructuredQName from a prefix, URI, and local name. |
Method Summary | |
---|---|
boolean |
equals(Object other)
Compare two StructuredQName values for equality. |
static StructuredQName |
fromClarkName(String expandedName)
Make a structuredQName from a Clark name |
static StructuredQName |
fromLexicalQName(CharSequence lexicalName,
boolean useDefault,
NameChecker checker,
NamespaceResolver resolver)
Make a structured QName from a lexical QName, using a supplied NamespaceResolver to resolve the prefix |
String |
getClarkName()
Get the expanded QName in Clark format, that is "{uri}local" if it is in a namespace, or just "local" otherwise. |
String |
getDisplayName()
Get the display name, that is the lexical QName in the form [prefix:]local-part |
String |
getLocalName()
Get the local part of the QName |
String |
getNamespaceURI()
Get the namespace URI of the QName. |
String |
getPrefix()
Get the prefix of the QName. |
int |
hashCode()
Get a hashcode to reflect the equals() method |
QName |
toJaxpQName()
Convert the StructuredQName to a javax.xml.namespace.QName |
String |
toString()
The toString() method displays the QName as a lexical QName, that is prefix:local |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public StructuredQName(String prefix, String uri, 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 NamePoolMethod Detail |
---|
public static StructuredQName fromClarkName(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.
IllegalArgumentException
- if the Clark name is malformedpublic static StructuredQName fromLexicalQName(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 prefix
XPathException
- 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 String getPrefix()
public String getNamespaceURI()
public String getLocalName()
public String getDisplayName()
public String getClarkName()
public String toString()
toString
in class Object
public boolean equals(Object other)
equals
in class Object
public int hashCode()
hashCode
in class Object
public QName toJaxpQName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |