Package org.apache.jackrabbit.core
Class NamespaceRegistryImpl
- java.lang.Object
- 
- org.apache.jackrabbit.core.NamespaceRegistryImpl
 
- 
- All Implemented Interfaces:
- NamespaceRegistry,- NamespaceEventListener,- StringIndex
 
 public class NamespaceRegistryImpl extends Object implements NamespaceRegistry, NamespaceEventListener, StringIndex ANamespaceRegistryImpl...
- 
- 
Field Summary- 
Fields inherited from interface javax.jcr.NamespaceRegistryNAMESPACE_EMPTY, NAMESPACE_JCR, NAMESPACE_MIX, NAMESPACE_NT, NAMESPACE_XML, PREFIX_EMPTY, PREFIX_JCR, PREFIX_MIX, PREFIX_NT, PREFIX_XML
 
- 
 - 
Constructor SummaryConstructors Constructor Description NamespaceRegistryImpl(FileSystem fs)Protected constructor: Constructs a new instance of this class.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexternalRemap(String oldPrefix, String newPrefix, String uri)Called when a namespace has been externally remapped.StringgetPrefix(String uri)String[]getPrefixes()StringgetURI(String prefix)String[]getURIs()StringindexToString(int idx)Returns the namespace URI for a given index (i.e.booleanisReservedURI(String uri)Returnstrueif the specified uri is one of the reserved URIs defined in this registry.voidregisterNamespace(String prefix, String uri)voidsetEventChannel(NamespaceEventChannel eventChannel)Set an event channel to inform about changes.intstringToIndex(String uri)Returns the index (i.e.voidunregisterNamespace(String prefix)
 
- 
- 
- 
Constructor Detail- 
NamespaceRegistryImplpublic NamespaceRegistryImpl(FileSystem fs) throws RepositoryException Protected constructor: Constructs a new instance of this class.- Parameters:
- fs- repository file system
- Throws:
- RepositoryException
 
 
- 
 - 
Method Detail- 
setEventChannelpublic void setEventChannel(NamespaceEventChannel eventChannel) Set an event channel to inform about changes.- Parameters:
- eventChannel- event channel
 
 - 
isReservedURIpublic boolean isReservedURI(String uri) Returnstrueif the specified uri is one of the reserved URIs defined in this registry.- Parameters:
- uri- The URI to test.
- Returns:
- trueif the specified uri is reserved;- falseotherwise.
 
 - 
stringToIndexpublic int stringToIndex(String uri) Returns the index (i.e. stable prefix) for the given namespace URI.- Specified by:
- stringToIndexin interface- StringIndex
- Parameters:
- uri- namespace URI
- Returns:
- namespace index
- Throws:
- IllegalArgumentException- if the namespace is not registered
 
 - 
indexToStringpublic String indexToString(int idx) Returns the namespace URI for a given index (i.e. stable prefix).- Specified by:
- indexToStringin interface- StringIndex
- Parameters:
- idx- namespace index
- Returns:
- namespace URI
- Throws:
- IllegalArgumentException- if the given index is invalid
 
 - 
registerNamespacepublic void registerNamespace(String prefix, String uri) throws NamespaceException, UnsupportedRepositoryOperationException, AccessDeniedException, RepositoryException - Specified by:
- registerNamespacein interface- NamespaceRegistry
- Throws:
- NamespaceException
- UnsupportedRepositoryOperationException
- AccessDeniedException
- RepositoryException
 
 - 
unregisterNamespacepublic void unregisterNamespace(String prefix) throws NamespaceException, UnsupportedRepositoryOperationException, AccessDeniedException, RepositoryException - Specified by:
- unregisterNamespacein interface- NamespaceRegistry
- Throws:
- NamespaceException
- UnsupportedRepositoryOperationException
- AccessDeniedException
- RepositoryException
 
 - 
getPrefixespublic String[] getPrefixes() throws RepositoryException - Specified by:
- getPrefixesin interface- NamespaceRegistry
- Throws:
- RepositoryException
 
 - 
getURIspublic String[] getURIs() throws RepositoryException - Specified by:
- getURIsin interface- NamespaceRegistry
- Throws:
- RepositoryException
 
 - 
getURIpublic String getURI(String prefix) throws NamespaceException - Specified by:
- getURIin interface- NamespaceRegistry
- Throws:
- NamespaceException
 
 - 
getPrefixpublic String getPrefix(String uri) throws NamespaceException - Specified by:
- getPrefixin interface- NamespaceRegistry
- Throws:
- NamespaceException
 
 - 
externalRemappublic void externalRemap(String oldPrefix, String newPrefix, String uri) throws RepositoryException Called when a namespace has been externally remapped.- Specified by:
- externalRemapin interface- NamespaceEventListener
- Parameters:
- oldPrefix- old prefix. if- nullthis is a fresh mapping
- newPrefix- new prefix. if- nullthis is an unmap operation
- uri- uri to map prefix to
- Throws:
- RepositoryException- if an error occurs
 
 
- 
 
-