|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.xml.namespace.QName
QName
class represents a combined definition of a
qualified name as defined in the following two
specifications:
The value of a QName contains a namespaceURI and a localPart. The localPart provides the local part of the qualified name. The namespaceURI is a URI reference identifying the namespace.
The prefix is included in the QName class to retain
lexical information where present in an XML input
source. The prefix is NOT used to compute the hash code or
in the equals
operation. In other words, equality is
defined only using the namespaceURI and the
localPart.
Constructor Summary | |
QName(java.lang.String localPart)
Constructor for the QName with just a local part. |
|
QName(java.lang.String namespaceURI,
java.lang.String localPart)
Constructor for the QName with a namespace URI and a local part. |
|
QName(java.lang.String namespaceURI,
java.lang.String localPart,
java.lang.String prefix)
Constructor for the QName. |
Method Summary | |
boolean |
equals(java.lang.Object obj)
Tests this QName for equality with another object. |
java.lang.String |
getLocalPart()
Gets the Local part for this QName. |
java.lang.String |
getNamespaceURI()
Gets the Namespace URI for this QName. |
java.lang.String |
getPrefix()
Gets the prefix for this QName. |
int |
hashCode()
Returns a hash code value for this QName object. |
java.lang.String |
toString()
Returns a string representation of this QName. |
static QName |
valueOf(java.lang.String s)
Returns a QName holding the value of the specified String. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public QName(java.lang.String localPart)
namespaceURI
, prefix
and
localPart
.
localPart
- Local part of the QName
java.lang.IllegalArgumentException
- If null
local part is specifiedpublic QName(java.lang.String namespaceURI, java.lang.String localPart)
prefix
.
namespaceURI
- Namespace URI for the QNamelocalPart
- Local part of the QName
java.lang.IllegalArgumentException
- If null
local part or namespaceURI is specifiedpublic QName(java.lang.String namespaceURI, java.lang.String localPart, java.lang.String prefix)
namespaceURI
- Namespace URI for the QNamelocalPart
- Local part of the QNameprefix
- The prefix of the QName
java.lang.IllegalArgumentException
- If null
local part or prefix is specifiedMethod Detail |
public java.lang.String getNamespaceURI()
public java.lang.String getLocalPart()
public java.lang.String getPrefix()
String
value of the prefix.public java.lang.String toString()
toString
in class java.lang.Object
public static QName valueOf(java.lang.String s)
s
- the string to be parsed
java.lang.IllegalArgumentException
- If the specified
String cannot be parsed as a QNamepublic final int hashCode()
Object.hashCode
method.
hashCode
in class java.lang.Object
public final boolean equals(java.lang.Object obj)
If the given object is not a QName or is null then this method returns false.
For two QNames to be considered equal requires that both
localPart and namespaceURI must be equal. This method uses
String.equals
to check equality of localPart
and namespaceURI.
This method satisfies the general contract of the Object.equals
method.
equals
in class java.lang.Object
obj
- the reference object with which to compare.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |