public final class Namespace
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Item
,
Serialized FormModifier and Type | Field and Description |
---|---|
static Namespace |
NO_NAMESPACE
The
Namespace for when not in a namespace |
static Namespace |
XML_NAMESPACE
The xml namespace.
|
static Namespace |
XMLNS_NAMESPACE
The xmlns namespace.
|
Constructor and Description |
---|
Namespace(java.lang.String prefix,
java.lang.String uri)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
boolean |
equals(java.lang.Object o)
Note: equals() is based on URI only.
|
boolean |
equalsAll(Namespace ns)
Tests whether two namespace are the same in both prefix
and namespace URI.
|
java.lang.String |
getPrefix()
Gets the prefix mapped to this Namespace.
|
static Namespace |
getSpecial(java.lang.String prefix)
Returns the special namespace if prefix is special, or null if not.
|
java.lang.String |
getURI()
Gets the namespace URI for this Namespace.
|
int |
hashCode()
Note: hashCode() is based on URI only.
|
java.lang.String |
tagNameOf(java.lang.String name)
Gets the tag name of the giving local name.
|
java.lang.String |
toString() |
public static final Namespace NO_NAMESPACE
Namespace
for when not in a namespacepublic static final Namespace XML_NAMESPACE
public static final Namespace XMLNS_NAMESPACE
public Namespace(java.lang.String prefix, java.lang.String uri)
prefix
- String prefix to map to this namespace.uri
- String URI for namespace.DOMException
- with NAMESPACE_ERR if the given prefix and uri
is invalidpublic static Namespace getSpecial(java.lang.String prefix)
public final java.lang.String tagNameOf(java.lang.String name)
public final java.lang.String getPrefix()
public final java.lang.String getURI()
public final boolean equalsAll(Namespace ns)
Note: unlike equals, it throws DOMException if prefix is the same but URI is different.
DOMException
- if they have the same prefix
but with different namespace URIpublic java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2005-2021 Potix Corporation. All Rights Reserved.