public interface NamespaceRegistry
NamespaceRegistry represents the global persistent namespace
registry of the JCR Repository.Workspace.getNamespaceRegistry()| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getPrefix(java.lang.String uri)
Returns the prefix to which the given URI is mapped
|
java.lang.String[] |
getPrefixes()
Returns an array holding all currently registered prefixes.
|
java.lang.String |
getURI(java.lang.String prefix)
Returns the URI to which the given prefix is mapped.
|
java.lang.String[] |
getURIs()
Returns an array holding all currently registered URIs.
|
void |
registerNamespace(java.lang.String prefix,
java.lang.String uri)
Sets a one-to-one mapping between prefix and URI in the global namespace registry of this repository.
|
void |
unregisterNamespace(java.lang.String prefix)
Removes a namespace mapping from the registry.
|
void registerNamespace(java.lang.String prefix,
java.lang.String uri)
throws NamespaceException,
UnsupportedRepositoryOperationException,
AccessDeniedException,
RepositoryException
NamespaceException.
On the other hand, taking a prefix that is already assigned to a URI and re-assigning it to a new URI
in effect unregisters that URI. Therefore, the same restrictions apply to this operation as to
NamespaceRegistry.unregisterNamespace:
jcr, nt, mix,
sv, xml, or the empty prefix) to a new URI will throw a
NamespaceException.
NAME or PATH property)
will throw a NamespaceException. This includes prefixes in use within in-content node type
definitions.
xml"
(in any combination of case) will throw a NamespaceException.
NamespaceException.
UnsupportedRepositoryOperationException.
If the session associated with the Workspace object through which this registry was acquired does not have sufficient permissions to register the
namespace an AccessDeniedException is thrown.
A RepositoryException is thrown if another error occurs.prefix - The prefix to be mapped.uri - The URI to be mapped.NamespaceException - if an illegal attempt is made to register a mapping.UnsupportedRepositoryOperationException - in a level 1 implementationAccessDeniedException - if the session associated with the Workspace object through which this registry was acquired does not have sufficient permissions to register the namespace.RepositoryException - if another error occurs.void unregisterNamespace(java.lang.String prefix)
throws NamespaceException,
UnsupportedRepositoryOperationException,
AccessDeniedException,
RepositoryException
jcr, nt,
mix, sv, xml or the empty namespace) will
throw a NamespaceException.
NAME or PATH property)
will throw a NamespaceException. This includes prefixes in use within in-content node type
definitions.
NamespaceException.
NamespaceException.
UnsupportedRepositoryOperationException.
If the session associated with the Workspace object through which this registry was acquired
does not have sufficient permissions to unregister the
namespace an AccessDeniedException is thrown.
A RepositoryException is thrown if another error occurs.prefix - The prefix of the mapping to be removed.NamespaceException - if an illegal attempt is made to remove a mapping.UnsupportedRepositoryOperationException - in a level 1 implementationAccessDeniedException - if the session associated with the Workspace object through which this registry was acquired does not have sufficient permissions
to unregister the namespace.RepositoryException - if another error occurs.java.lang.String[] getPrefixes()
throws RepositoryException
RepositoryException - if an error occurs.java.lang.String[] getURIs()
throws RepositoryException
RepositoryException - if an error occurs.java.lang.String getURI(java.lang.String prefix)
throws NamespaceException,
RepositoryException
prefix - a stringNamespaceException - if the prefix is unknown.RepositoryException - is another error occursjava.lang.String getPrefix(java.lang.String uri)
throws NamespaceException,
RepositoryException
uri - a stringNamespaceException - if the URI is unknown.RepositoryException - is another error occurs