public class NamespaceRegistryImpl extends Object implements NamespaceRegistry, NamespaceEventListener, StringIndex
NamespaceRegistryImpl ...NAMESPACE_EMPTY, NAMESPACE_JCR, NAMESPACE_MIX, NAMESPACE_NT, NAMESPACE_XML, PREFIX_EMPTY, PREFIX_JCR, PREFIX_MIX, PREFIX_NT, PREFIX_XML| Constructor and Description |
|---|
NamespaceRegistryImpl(FileSystem fs)
Protected constructor: Constructs a new instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
externalRemap(String oldPrefix,
String newPrefix,
String uri)
Called when a namespace has been externally remapped.
|
String |
getPrefix(String uri) |
String[] |
getPrefixes() |
String |
getURI(String prefix) |
String[] |
getURIs() |
String |
indexToString(int idx)
Returns the namespace URI for a given index (i.e.
|
boolean |
isReservedURI(String uri)
Returns
true if the specified uri is one of the reserved
URIs defined in this registry. |
void |
registerNamespace(String prefix,
String uri) |
void |
setEventChannel(NamespaceEventChannel eventChannel)
Set an event channel to inform about changes.
|
int |
stringToIndex(String uri)
Returns the index (i.e.
|
void |
unregisterNamespace(String prefix) |
public NamespaceRegistryImpl(FileSystem fs) throws RepositoryException
fs - repository file systemRepositoryExceptionpublic void setEventChannel(NamespaceEventChannel eventChannel)
eventChannel - event channelpublic boolean isReservedURI(String uri)
true if the specified uri is one of the reserved
URIs defined in this registry.uri - The URI to test.true if the specified uri is reserved;
false otherwise.public int stringToIndex(String uri)
stringToIndex in interface StringIndexuri - namespace URIIllegalArgumentException - if the namespace is not registeredpublic String indexToString(int idx)
indexToString in interface StringIndexidx - namespace indexIllegalArgumentException - if the given index is invalidpublic void registerNamespace(String prefix, String uri) throws NamespaceException, UnsupportedRepositoryOperationException, AccessDeniedException, RepositoryException
registerNamespace in interface NamespaceRegistryNamespaceExceptionUnsupportedRepositoryOperationExceptionAccessDeniedExceptionRepositoryExceptionpublic void unregisterNamespace(String prefix) throws NamespaceException, UnsupportedRepositoryOperationException, AccessDeniedException, RepositoryException
unregisterNamespace in interface NamespaceRegistryNamespaceExceptionUnsupportedRepositoryOperationExceptionAccessDeniedExceptionRepositoryExceptionpublic String[] getPrefixes() throws RepositoryException
getPrefixes in interface NamespaceRegistryRepositoryExceptionpublic String[] getURIs() throws RepositoryException
getURIs in interface NamespaceRegistryRepositoryExceptionpublic String getURI(String prefix) throws NamespaceException
getURI in interface NamespaceRegistryNamespaceExceptionpublic String getPrefix(String uri) throws NamespaceException
getPrefix in interface NamespaceRegistryNamespaceExceptionpublic void externalRemap(String oldPrefix, String newPrefix, String uri) throws RepositoryException
externalRemap in interface NamespaceEventListeneroldPrefix - old prefix. if null this is a fresh mappingnewPrefix - new prefix. if null this is an unmap operationuri - uri to map prefix toRepositoryException - if an error occursCopyright © 2004–2022 The Apache Software Foundation. All rights reserved.