public final class Namespace extends Object implements Serializable, Cloneable
Item,
Serialized Form| Modifier 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(String prefix,
String uri)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
clone() |
boolean |
equals(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.
|
String |
getPrefix()
Gets the prefix mapped to this Namespace.
|
static Namespace |
getSpecial(String prefix)
Returns the special namespace if prefix is special, or null if not.
|
String |
getURI()
Gets the namespace URI for this Namespace.
|
int |
hashCode()
Note: hashCode() is based on URI only.
|
String |
tagNameOf(String name)
Gets the tag name of the giving local name.
|
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(String prefix, 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(String prefix)
public final String getPrefix()
public final 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 boolean equals(Object o)
public int hashCode()
Copyright © 2018. All rights reserved.