public final class Namespace extends Object
Modifier and Type | Field and Description |
---|---|
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. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object ob)
This tests for equality - Two
Namespaces
are equal if and only if their URIs are byte-for-byte equals. |
static Namespace |
getNamespace(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(String prefix,
String uri)
This will retrieve (if in existence) or create (if not) a
Namespace for the supplied prefix and URI. |
String |
getPrefix()
This returns the prefix mapped to this
Namespace . |
String |
getURI()
This returns the namespace URI for this
Namespace . |
int |
hashCode()
This returns a probably unique hash code for the
Namespace . |
String |
toString()
This returns a
String representation of this
Namespace , suitable for use in debugging. |
public static final Namespace NO_NAMESPACE
Namespace
for when not in a namespacepublic static final Namespace XML_NAMESPACE
Namespace
for the standard xml prefix.public static Namespace getNamespace(String prefix, String uri)
Namespace
for the supplied prefix and URI.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.public static Namespace getNamespace(String uri)
Namespace
for the supplied URI, and make it usable
as a default namespace, as no prefix is supplied.uri
- String
URI of new Namespace
.Namespace
- ready to use namespace.public String getPrefix()
Namespace
.String
- prefix for this Namespace
.public String getURI()
Namespace
.String
- URI for this Namespace
.public boolean equals(Object ob)
Namespaces
are equal if and only if their URIs are byte-for-byte equals.public String toString()
String
representation of this
Namespace
, suitable for use in debugging.Copyright © 2012 JBoss by Red Hat. All Rights Reserved.