Class ReadWriteNamespaceRegistry
java.lang.Object
org.apache.jackrabbit.oak.plugins.name.ReadOnlyNamespaceRegistry
org.apache.jackrabbit.oak.plugins.name.ReadWriteNamespaceRegistry
- All Implemented Interfaces:
NamespaceRegistry,NamespaceConstants
Writable namespace registry. Mainly for use to implement the full JCR API.
-
Field Summary
Fields inherited from interface org.apache.jackrabbit.oak.spi.namespace.NamespaceConstants
NAMESPACE_OAK, NAMESPACE_REP, NAMESPACE_SV, NAMESPACE_XMLNS, NAMESPACES_PATH, PREFIX_OAK, PREFIX_REP, PREFIX_SV, PREFIX_XMLNS, REP_NAMESPACES, REP_NSDATA, REP_PREFIXES, REP_URIS, RESERVED_PREFIXES, RESERVED_URISFields inherited from interface javax.jcr.NamespaceRegistry
NAMESPACE_EMPTY, NAMESPACE_JCR, NAMESPACE_MIX, NAMESPACE_NT, NAMESPACE_XML, PREFIX_EMPTY, PREFIX_JCR, PREFIX_MIX, PREFIX_NT, PREFIX_XML -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidregisterNamespace(String prefix, String uri) Sets a one-to-one mapping betweenprefixanduriin the global namespace registry of this repository.voidunregisterNamespace(String prefix) Removes a namespace mapping from the registry.Methods inherited from class org.apache.jackrabbit.oak.plugins.name.ReadOnlyNamespaceRegistry
getPrefix, getPrefixes, getURI, getURIs
-
Constructor Details
-
ReadWriteNamespaceRegistry
-
-
Method Details
-
registerNamespace
Description copied from interface:NamespaceRegistrySets a one-to-one mapping betweenprefixanduriin the global namespace registry of this repository.Assigning a new prefix to a URI that already exists in the namespace registry erases the old prefix. In general this can almost always be done, though an implementation is free to prevent particular remappings by throwing a
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.- Specified by:
registerNamespacein interfaceNamespaceRegistry- Overrides:
registerNamespacein classReadOnlyNamespaceRegistry- Parameters:
prefix- The prefix to be mapped.uri- The URI to be mapped.- Throws:
RepositoryException- if another error occurs.
-
unregisterNamespace
Description copied from interface:NamespaceRegistryRemoves a namespace mapping from the registry.- Specified by:
unregisterNamespacein interfaceNamespaceRegistry- Overrides:
unregisterNamespacein classReadOnlyNamespaceRegistry- Parameters:
prefix- The prefix of the mapping to be removed.- Throws:
RepositoryException- if another error occurs.
-