public interface NamespaceRegistry
NamespaceRegistry
represents the global persistent namespace
registry of the JCR Repository.Workspace.getNamespaceRegistry()
Modifier and Type | Method and Description |
---|---|
String |
getPrefix(String uri)
Returns the prefix to which the given URI is mapped
|
String[] |
getPrefixes()
Returns an array holding all currently registered prefixes.
|
String |
getURI(String prefix)
Returns the URI to which the given prefix is mapped.
|
String[] |
getURIs()
Returns an array holding all currently registered URIs.
|
void |
registerNamespace(String prefix,
String uri)
Sets a one-to-one mapping between prefix and URI in the global namespace registry of this repository.
|
void |
unregisterNamespace(String prefix)
Removes a namespace mapping from the registry.
|
void registerNamespace(String prefix, 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(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.String[] getPrefixes() throws RepositoryException
RepositoryException
- if an error occurs.String[] getURIs() throws RepositoryException
RepositoryException
- if an error occurs.String getURI(String prefix) throws NamespaceException, RepositoryException
prefix
- a stringNamespaceException
- if the prefix is unknown.RepositoryException
- is another error occursString getPrefix(String uri) throws NamespaceException, RepositoryException
uri
- a stringNamespaceException
- if the URI is unknown.RepositoryException
- is another error occursCopyright © 2004-2013 Day Management AG. All Rights Reserved.