public class QName extends Object implements Serializable
Constructor and Description |
---|
QName(String localPart)
Constructor for the QName with just a local part.
|
QName(String namespaceURI,
String localPart)
Constructor for the QName with a namespace URI and a local part.
|
QName(String namespaceURI,
String localPart,
String prefix)
Constructor for the QName.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Tests this QName for equality with another object.
|
String |
getLocalPart()
Gets the Local part for this QName.
|
String |
getNamespaceURI()
Gets the Namespace URI for this QName.
|
String |
getPrefix()
Gets the prefix for this QName.
|
int |
hashCode()
Returns a hash code value for this QName object.
|
String |
toString()
Returns a string representation of this QName.
|
static QName |
valueOf(String s)
Returns a QName holding the value of the specified String.
|
public QName(String localPart)
namespaceURI
,
prefix
and localPart
.localPart
- Local part of the QNameIllegalArgumentException
- If null local part is specifiedpublic QName(String namespaceURI, String localPart)
prefix
.namespaceURI
- Namespace URI for the QNamelocalPart
- Local part of the QNameIllegalArgumentException
- If null local part or namespaceURI is specifiedpublic QName(String namespaceURI, String localPart, String prefix)
namespaceURI
- Namespace URI for the QNamelocalPart
- Local part of the QNameprefix
- The prefix of the QNameIllegalArgumentException
- If null local part or prefix is specifiedpublic String getNamespaceURI()
public String getLocalPart()
public String getPrefix()
String
value of the prefix.public String toString()
public static QName valueOf(String s)
s
- the string to be parsedIllegalArgumentException
- If the specified String cannot be parsed as a QNamepublic final int hashCode()
Object.hashCode
method. public final boolean equals(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.
Copyright © 2013. All Rights Reserved.