|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectQName
public final class QName
This class represents unique identifiers for XML elements (tags) or attributes (names).
It should be noted that QName.valueOf(null, "name") and
QName.valueOf("", "name") are distinct; the first one has no
namespace associated with; whereas the second is associated
to the root namespace.
QName have a textual representation (CharSequence) which
is either the local name (if no namespace URI) or
{namespaceURI}localName (otherwise).
| Method Summary | |
|---|---|
char |
charAt(int index)
Returns the character at the specified index. |
boolean |
equals(Object obj)
Instances of this class are unique; object's equality can be replaced object identity ( ==). |
CharSequence |
getLocalName()
Returns the local part of this qualified name or the full qualified name if there is no namespace. |
CharSequence |
getNamespaceURI()
Returns the namespace URI of this qualified name or null
if none (the local name is then the full qualified name). |
int |
hashCode()
Returns the hash code for this qualified name. |
int |
length()
Returns the length of this character sequence. |
CharSequence |
subSequence(int start,
int end)
Returns a new character sequence that is a subsequence of this sequence. |
String |
toString()
Returns the String representation of this qualified name. |
static QName |
valueOf(CharSequence name)
Returns the qualified name corresponding to the specified character sequence representation (may include the "{namespaceURI}" prefix). |
static QName |
valueOf(CharSequence namespaceURI,
CharSequence localName)
Returns the qualified name corresponding to the specified namespace URI and local name. |
static QName |
valueOf(String name)
Equivalent to valueOf(CharSequence) (for J2ME compatibility). |
| Methods inherited from class Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static QName valueOf(CharSequence name)
name - the qualified name lexical representation.toString()public static QName valueOf(String name)
valueOf(CharSequence) (for J2ME compatibility).
name - the qualified name lexical representation.toString()
public static QName valueOf(CharSequence namespaceURI,
CharSequence localName)
namespaceURI - the URI reference or null if none.localName - the local name.toString()public CharSequence getLocalName()
public CharSequence getNamespaceURI()
null
if none (the local name is then the full qualified name).
nullpublic boolean equals(Object obj)
==).
equals in class Objectthis == objpublic String toString()
String representation of this qualified name.
toString in interface CharSequencetoString in class Objectpublic int hashCode()
Note: Returns the same hashCode as java.lang.String
(consistent with equals(java.lang.Object))
hashCode in class Objectpublic char charAt(int index)
charAt in interface CharSequenceindex - the index of the character starting at 0.
IndexOutOfBoundsException - if ((index < 0) ||
(index >= length))public int length()
length in interface CharSequence
public CharSequence subSequence(int start,
int end)
subSequence in interface CharSequencestart - the index of the first character inclusive.end - the index of the last character exclusive.
start position and ending just before the specified
end position.
IndexOutOfBoundsException - if (start < 0) || (end < 0) ||
(start > end) || (end > this.length())
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||