@ThreadSafe public interface NamespaceRegistry
names
.Modifier and Type | Interface and Description |
---|---|
static interface |
NamespaceRegistry.Holder |
static interface |
NamespaceRegistry.Namespace
Representation of a single namespace at a single point in time.
|
Modifier and Type | Method and Description |
---|---|
String |
getDefaultNamespaceUri()
Return the namespace URI that is currently mapped to the empty prefix, or null if there is no current default namespace.
|
String |
getNamespaceForPrefix(String prefix)
Get the namespace URI for the supplied prefix.
|
Set<NamespaceRegistry.Namespace> |
getNamespaces()
Obtain a snapshot of all of the
namespaces registered at the time this method is called. |
String |
getPrefixForNamespaceUri(String namespaceUri,
boolean generateIfMissing)
Return the prefix used for the supplied namespace URI.
|
Set<String> |
getRegisteredNamespaceUris()
Obtain the set of namespaces that are registered.
|
boolean |
isRegisteredNamespaceUri(String namespaceUri)
Return whether there is a registered prefix for the supplied namespace URI.
|
void |
register(Iterable<NamespaceRegistry.Namespace> namespaces) |
String |
register(String prefix,
String namespaceUri)
Register a new namespace using the supplied prefix, returning the namespace URI previously registered under that prefix.
|
boolean |
unregister(String namespaceUri)
Unregister the namespace with the supplied URI.
|
String getDefaultNamespaceUri()
String getNamespaceForPrefix(String prefix)
prefix
- the namespace prefixIllegalArgumentException
- if the prefix is nullString getPrefixForNamespaceUri(String namespaceUri, boolean generateIfMissing)
namespaceUri
- the namespace URIgenerateIfMissing
- true if the namespace URI has not already been registered and the method should auto-register the
namespace with a generated prefix, or false if the method should never auto-register the namespacenull
if the namespace has not been registered
and generateIfMissing
is false
IllegalArgumentException
- if the namespace URI is nullisRegisteredNamespaceUri(String)
boolean isRegisteredNamespaceUri(String namespaceUri)
namespaceUri
- the namespace URIIllegalArgumentException
- if the namespace URI is nullString register(String prefix, String namespaceUri)
prefix
- the prefix for the namespace, or null if a namesapce prefix should be generated automaticallynamespaceUri
- the namespace URIIllegalArgumentException
- if the namespace URI is nullvoid register(Iterable<NamespaceRegistry.Namespace> namespaces)
boolean unregister(String namespaceUri)
namespaceUri
- the namespace URIIllegalArgumentException
- if the namespace URI is nullNamespaceException
- if there is a problem unregistering the namespaceSet<String> getRegisteredNamespaceUris()
Set<NamespaceRegistry.Namespace> getNamespaces()
namespaces
registered at the time this method is called. The resulting
set is immutable, and will not reflect changes made to the registry.NamespaceRegistry.Namespace
objects reflecting a snapshot of the registry; never nullCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.