public interface OMNamespace
Implementations of this interface must be immutable or behave as if they were immutable,
i.e. getPrefix()
and getNamespaceURI()
must always return the same
values when invoked on the same instance.
Implementations must override Object.equals(Object)
and Object.hashCode()
. Two
OMNamespace
instances are considered equal if their namespace URIs and prefixes are
equal.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(String uri,
String prefix)
Method equals.
|
String |
getName()
Deprecated.
This method is deprecated. Please use getNamespaceURI() method instead.
|
String |
getNamespaceURI()
Get the namespace URI.
|
String |
getPrefix()
Get the namespace prefix.
|
boolean equals(String uri, String prefix)
uri
- prefix
- String getPrefix()
null
for instances returned by
OMFactory.createOMNamespace(String, String)
. This indicates that Axiom should
generate a namespace prefix when this instance is passed to one of the factory methods in
OMFactory
. In all other cases the return value is not null. In particular, an empty
string indicates that no prefix is used, i.e. that the namespace is used as default
namespace.String getName()
String getNamespaceURI()
null
. It may return an empty
string if this instance represents a namespace declaration of type xmlns="". This
may be the case for instances returned by OMElement.getAllDeclaredNamespaces()
. On
the other hand, methods such as OMNamedInformationItem.getNamespace()
will return
null
for information items that have no namespace. In that case the returned
string is never empty.Copyright © The Apache Software Foundation. All Rights Reserved.