|
JDOM 2.0.2 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jdom2.Namespace
public final class Namespace
An XML namespace representation, as well as a factory for creating XML
namespace objects. All methods on Namespace (including
getNamespace(String) and getNamespace(String, String))
are thread-safe.
See NamespaceAware for additional notes on how Namespaces are
'in-scope' in JDOM content, and how those in-scope Namespaces are accessed.
NamespaceAware,
Serialized Form| Field Summary | |
|---|---|
static Namespace |
NO_NAMESPACE
Define a Namespace for when not in a namespace |
static Namespace |
XML_NAMESPACE
Define a Namespace for the standard xml prefix. |
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object ob)
This tests for equality - Two Namespaces
are equal if and only if their URIs are byte-for-byte equals. |
static Namespace |
getNamespace(java.lang.String uri)
This will retrieve (if in existence) or create (if not) a Namespace for the supplied URI, and make it usable
as a default namespace, as no prefix is supplied. |
static Namespace |
getNamespace(java.lang.String prefix,
java.lang.String uri)
This will retrieve (if in existence) or create (if not) a Namespace for the supplied prefix and uri. |
java.lang.String |
getPrefix()
This returns the prefix mapped to this Namespace. |
java.lang.String |
getURI()
This returns the namespace URI for this Namespace. |
int |
hashCode()
This returns the hash code for the Namespace that conforms
to the 'equals()' contract. |
java.lang.String |
toString()
This returns a String representation of this
Namespace, suitable for use in debugging. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Namespace NO_NAMESPACE
Namespace for when not in a namespace
public static final Namespace XML_NAMESPACE
Namespace for the standard xml prefix.
| Method Detail |
|---|
public static Namespace getNamespace(java.lang.String prefix,
java.lang.String uri)
Namespace for the supplied prefix and uri.
This method is thread-safe.
prefix - String prefix to map to
Namespace.uri - String URI of new Namespace.
Namespace - ready to use namespace.
IllegalNameException - if the given prefix and uri make up
an illegal namespace name.Verifier.checkNamespacePrefix(String),
Verifier.checkNamespaceURI(String)public static Namespace getNamespace(java.lang.String uri)
Namespace for the supplied URI, and make it usable
as a default namespace, as no prefix is supplied.
This method is thread-safe.
uri - String URI of new Namespace.
Namespace - ready to use namespace.public java.lang.String getPrefix()
Namespace.
String - prefix for this Namespace.public java.lang.String getURI()
Namespace.
String - URI for this Namespace.public boolean equals(java.lang.Object ob)
Namespaces
are equal if and only if their URIs are byte-for-byte equals.
equals in class java.lang.Objectob - Object to compare to this Namespace.
boolean - whether the supplied object is equal to
this Namespace.public java.lang.String toString()
String representation of this
Namespace, suitable for use in debugging.
toString in class java.lang.ObjectString - information about this instance.public int hashCode()
Namespace that conforms
to the 'equals()' contract.
If two namespaces have the same URI, they are equal and have the same hash code, even if they have different prefixes.
hashCode in class java.lang.Objectint - hash code for this Namespace.
|
JDOM 2.0.2 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||