|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
NamespaceRegistry represents the global persistent namespace
registry of the JCR Repository.
Workspace.getNamespaceRegistry()| Method Summary | |
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. |
| Method Detail |
public 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 implementation
AccessDeniedException - 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.
public 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 implementation
AccessDeniedException - 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.
public java.lang.String[] getPrefixes()
throws RepositoryException
RepositoryException - if an error occurs.
public java.lang.String[] getURIs()
throws RepositoryException
RepositoryException - if an error occurs.
public java.lang.String getURI(java.lang.String prefix)
throws NamespaceException,
RepositoryException
prefix - a string
NamespaceException - if the prefix is unknown.
RepositoryException - is another error occurs
public java.lang.String getPrefix(java.lang.String uri)
throws NamespaceException,
RepositoryException
uri - a string
NamespaceException - if the URI is unknown.
RepositoryException - is another error occurs
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||