|
|||||||||
| Home >> All >> org >> [ jdom overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.jdom
Class Namespace

java.lang.Objectorg.jdom.Namespace
- public final class Namespace
- extends java.lang.Object
An XML namespace representation, as well as a factory for creating XML namespace objects. Namespaces are not Serializable, however objects that use namespaces have special logic to handle serialization manually. These classes call the getNamespace() method on deserialization to ensure there is one unique Namespace object for any unique prefix/uri pair.
- Version:
- $Revision: 1.41 $, $Date: 2004/02/27 11:32:57 $
| Field Summary | |
private static java.lang.String |
CVS_ID
|
private static java.util.HashMap |
namespaces
Factory list of namespaces. |
static Namespace |
NO_NAMESPACE
Define a Namespace for when not in a namespace |
private java.lang.String |
prefix
The prefix mapped to this namespace |
private java.lang.String |
uri
The URI for this namespace |
static Namespace |
XML_NAMESPACE
Define a Namespace for the standard xml prefix. |
| Constructor Summary | |
private |
Namespace(java.lang.String prefix,
java.lang.String uri)
This constructor handles creation of a Namespace object
with a prefix and URI; it is intentionally left private
so that it cannot be invoked by external programs/code. |
| 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 a probably unique hash code for the Namespace. |
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 |
CVS_ID
private static final java.lang.String CVS_ID
- See Also:
- Constant Field Values
namespaces
private static java.util.HashMap namespaces
- Factory list of namespaces.
Keys are prefix&URI.
Values are Namespace objects
NO_NAMESPACE
public static final Namespace NO_NAMESPACE
- Define a
Namespacefor when not in a namespace
XML_NAMESPACE
public static final Namespace XML_NAMESPACE
- Define a
Namespacefor the standard xml prefix.
prefix
private java.lang.String prefix
- The prefix mapped to this namespace
uri
private java.lang.String uri
- The URI for this namespace
| Constructor Detail |
Namespace
private Namespace(java.lang.String prefix, java.lang.String uri)
- This constructor handles creation of a
Namespaceobject with a prefix and URI; it is intentionally leftprivateso that it cannot be invoked by external programs/code.
| Method Detail |
getNamespace
public static Namespace getNamespace(java.lang.String prefix, java.lang.String uri)
- This will retrieve (if in existence) or create (if not) a
Namespacefor the supplied prefix and URI.
getNamespace
public static Namespace getNamespace(java.lang.String uri)
- This will retrieve (if in existence) or create (if not) a
Namespacefor the supplied URI, and make it usable as a default namespace, as no prefix is supplied.
getPrefix
public java.lang.String getPrefix()
- This returns the prefix mapped to this
Namespace.
getURI
public java.lang.String getURI()
- This returns the namespace URI for this
Namespace.
equals
public boolean equals(java.lang.Object ob)
- This tests for equality - Two
Namespacesare equal if and only if their URIs are byte-for-byte equals.
toString
public java.lang.String toString()
- This returns a
Stringrepresentation of thisNamespace, suitable for use in debugging.
hashCode
public int hashCode()
- This returns a probably unique hash code for the
Namespace. If two namespaces have the same URI, they are equal and have the same hash code, even if they have different prefixes.
|
|||||||||
| Home >> All >> org >> [ jdom overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.jdom.Namespace