Class ReadOnlyNamespaceRegistry
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.name.ReadOnlyNamespaceRegistry
-
- All Implemented Interfaces:
NamespaceRegistry
,NamespaceConstants
- Direct Known Subclasses:
ReadWriteNamespaceRegistry
public class ReadOnlyNamespaceRegistry extends Object implements NamespaceRegistry, NamespaceConstants
Read-only namespace registry. Used mostly internally when access to the in-content registered namespaces is needed. See theReadWriteNamespaceRegistry
subclass for a more complete registry implementation that supports also namespace modifications and that's thus better suited for use in in implementing the full JCR API.
-
-
Field Summary
Fields Modifier and Type Field Description protected Tree
namespaces
protected Tree
nsdata
-
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_URIS
-
Fields 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 Constructor Description ReadOnlyNamespaceRegistry(Root root)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkConsistency()
@NotNull String
getPrefix(String uri)
@NotNull String[]
getPrefixes()
@NotNull String
getURI(String prefix)
@NotNull String[]
getURIs()
void
registerNamespace(String prefix, String uri)
void
unregisterNamespace(String prefix)
-
-
-
Constructor Detail
-
ReadOnlyNamespaceRegistry
public ReadOnlyNamespaceRegistry(Root root)
-
-
Method Detail
-
registerNamespace
public void registerNamespace(String prefix, String uri) throws RepositoryException
- Specified by:
registerNamespace
in interfaceNamespaceRegistry
- Throws:
RepositoryException
-
unregisterNamespace
public void unregisterNamespace(String prefix) throws RepositoryException
- Specified by:
unregisterNamespace
in interfaceNamespaceRegistry
- Throws:
RepositoryException
-
getPrefixes
@NotNull public @NotNull String[] getPrefixes()
- Specified by:
getPrefixes
in interfaceNamespaceRegistry
-
getURIs
@NotNull public @NotNull String[] getURIs()
- Specified by:
getURIs
in interfaceNamespaceRegistry
-
getURI
@NotNull public @NotNull String getURI(String prefix) throws NamespaceException
- Specified by:
getURI
in interfaceNamespaceRegistry
- Throws:
NamespaceException
-
getPrefix
@NotNull public @NotNull String getPrefix(String uri) throws NamespaceException
- Specified by:
getPrefix
in interfaceNamespaceRegistry
- Throws:
NamespaceException
-
checkConsistency
protected void checkConsistency()
-
-