QName represents a qualified name
as defined in the XML specifications: XML Schema Part2:
Datatypes specification, Namespaces
in XML.
The value of a QName contains a Namespace
URI, local part and
prefix.
The prefix is included in QName to retain lexical
information when present in an XML input source. The prefix is
NOT used in QName. or to compute the QName.. Equality and the hash code are defined using
only the Namespace URI and local part.
If not specified, the Namespace URI is set to XMLConstants..
If not specified, the prefix is set to XMLConstants..
QName is immutable.
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final String | |
| private final String | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | Returns: true if the given Object is
equal to this QName else falsethe objectToTest)Object to test for
equality with this QNameOverrides java. Test this |
| public String | |
| public String | |
| public String | |
| public final int | Returns: hash code for thisQName ObjectOverrides java. Generate the hash code for this |
| public String | Returns: the string representation of thisQNameOverrides java. Returns the string representation of this |
| public static QName |
| localPart | back to summary |
|---|---|
| private final String localPart | |
| namespaceURI | back to summary |
|---|---|
| private final String namespaceURI | |
| prefix | back to summary |
|---|---|
| private final String prefix | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| QName | back to summary |
|---|---|
| public QName(final String namespaceURI, final String localPart)
If the Namespace URI is If the local part is When using this constructor, the prefix is set to The Namespace URI is not validated as a URI reference. The local part is not validated as a NCName as specified in Namespaces in XML.
| |
| QName | back to summary |
|---|---|
| public QName(String namespaceURI, String localPart, String prefix)
If the Namespace URI is If the local part is If the prefix is The Namespace URI is not validated as a URI reference. The local part and prefix are not validated as a NCName as specified in Namespaces in XML.
| |
| QName | back to summary |
|---|---|
| public QName(String localPart)
If the local part is When using this constructor, the Namespace URI is set to
In an XML context, all Element and Attribute names exist
in the context of a Namespace. Making this explicit during the
construction of a The local part is not validated as a NCName as specified in Namespaces in XML.
| |
| equals | back to summary |
|---|---|
| public final boolean equals(Object objectToTest) Overrides java. Test this If the Two This method satisfies the general contract of
| |
| getLocalPart | back to summary |
|---|---|
| public String getLocalPart() Get the local part of this
| |
| getNamespaceURI | back to summary |
|---|---|
| public String getNamespaceURI() Get the Namespace URI of this
| |
| getPrefix | back to summary |
|---|---|
| public String getPrefix() Get the prefix of this The prefix assigned to a
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Overrides java. Generate the hash code for this The hash code is calculated using both the Namespace URI and
the local part of the This method satisfies the general contract of
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns the string representation of this
If NamespaceURI is null, only LocalPart is returned.
API Note The
| |
| valueOf | back to summary |
|---|---|
| public static QName valueOf(String qNameAsString) Returns a
Since the Prefix is not represented in the string form, it will be
set to XMLConstants..
API Note This method does not perform full validation of the resulting
| |