@NotThreadSafe public class LocalNamespaceRegistry extends SimpleNamespaceRegistry
NamespaceRegistry implementation that can be used to track transient registrations for another delegate
registry.NamespaceRegistry.Holder, NamespaceRegistry.NamespaceDEFAULT_NAMESPACE_URI, DEFAULT_PREFIX_NUMBER_FORMAT, DEFAULT_PREFIX_TEMPLATE| Constructor and Description |
|---|
LocalNamespaceRegistry(NamespaceRegistry delegate) |
LocalNamespaceRegistry(NamespaceRegistry delegate,
String defaultNamespaceUri) |
| 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.
|
Set<NamespaceRegistry.Namespace> |
getLocalNamespaces()
Obtain the set of namespaces that are overridden within this
LocalNamespaceRegistry instance. |
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.
|
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.
|
clear, generatePrefix, getGeneratedPrefixTemplate, register, setGeneratedPrefixTemplate, toStringpublic LocalNamespaceRegistry(NamespaceRegistry delegate)
delegate - the namespace registry that this registry should delegate to if not found locallypublic LocalNamespaceRegistry(NamespaceRegistry delegate, String defaultNamespaceUri)
delegate - the namespace registry that this registry should delegate to if not found locallydefaultNamespaceUri - the namespace URI to use for the default prefixpublic String getDefaultNamespaceUri()
NamespaceRegistrygetDefaultNamespaceUri in interface NamespaceRegistrygetDefaultNamespaceUri in class SimpleNamespaceRegistrypublic String getNamespaceForPrefix(String prefix)
NamespaceRegistrygetNamespaceForPrefix in interface NamespaceRegistrygetNamespaceForPrefix in class SimpleNamespaceRegistryprefix - the namespace prefixpublic Set<NamespaceRegistry.Namespace> getNamespaces()
NamespaceRegistrynamespaces registered at the time this method is called. The resulting
set is immutable, and will not reflect changes made to the registry.getNamespaces in interface NamespaceRegistrygetNamespaces in class SimpleNamespaceRegistryNamespaceRegistry.Namespace objects reflecting a snapshot of the registry; never nullpublic Set<NamespaceRegistry.Namespace> getLocalNamespaces()
LocalNamespaceRegistry instance.public String getPrefixForNamespaceUri(String namespaceUri, boolean generateIfMissing)
NamespaceRegistrygetPrefixForNamespaceUri in interface NamespaceRegistrygetPrefixForNamespaceUri in class SimpleNamespaceRegistrynamespaceUri - 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 falseNamespaceRegistry.isRegisteredNamespaceUri(String)public Set<String> getRegisteredNamespaceUris()
NamespaceRegistrygetRegisteredNamespaceUris in interface NamespaceRegistrygetRegisteredNamespaceUris in class SimpleNamespaceRegistrypublic boolean isRegisteredNamespaceUri(String namespaceUri)
NamespaceRegistryisRegisteredNamespaceUri in interface NamespaceRegistryisRegisteredNamespaceUri in class SimpleNamespaceRegistrynamespaceUri - the namespace URIpublic String register(String prefix, String namespaceUri)
NamespaceRegistryregister in interface NamespaceRegistryregister in class SimpleNamespaceRegistryprefix - the prefix for the namespace, or null if a namesapce prefix should be generated automaticallynamespaceUri - the namespace URIpublic boolean unregister(String namespaceUri)
NamespaceRegistryunregister in interface NamespaceRegistryunregister in class SimpleNamespaceRegistrynamespaceUri - the namespace URICopyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.