public class NamespaceRegistryImpl extends Object implements javax.jcr.NamespaceRegistry, NamespaceEventListener, StringIndex
NamespaceRegistryImpl
...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 javax.jcr.RepositoryException
fs
- repository file systemjavax.jcr.RepositoryException
public 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 StringIndex
uri
- namespace URIIllegalArgumentException
- if the namespace is not registeredpublic String indexToString(int idx)
indexToString
in interface StringIndex
idx
- namespace indexIllegalArgumentException
- if the given index is invalidpublic void registerNamespace(String prefix, String uri) throws javax.jcr.NamespaceException, javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
registerNamespace
in interface javax.jcr.NamespaceRegistry
javax.jcr.NamespaceException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.AccessDeniedException
javax.jcr.RepositoryException
public void unregisterNamespace(String prefix) throws javax.jcr.NamespaceException, javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
unregisterNamespace
in interface javax.jcr.NamespaceRegistry
javax.jcr.NamespaceException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.AccessDeniedException
javax.jcr.RepositoryException
public String[] getPrefixes() throws javax.jcr.RepositoryException
getPrefixes
in interface javax.jcr.NamespaceRegistry
javax.jcr.RepositoryException
public String[] getURIs() throws javax.jcr.RepositoryException
getURIs
in interface javax.jcr.NamespaceRegistry
javax.jcr.RepositoryException
public String getURI(String prefix) throws javax.jcr.NamespaceException
getURI
in interface javax.jcr.NamespaceRegistry
javax.jcr.NamespaceException
public String getPrefix(String uri) throws javax.jcr.NamespaceException
getPrefix
in interface javax.jcr.NamespaceRegistry
javax.jcr.NamespaceException
public void externalRemap(String oldPrefix, String newPrefix, String uri) throws javax.jcr.RepositoryException
externalRemap
in interface NamespaceEventListener
oldPrefix
- old prefix. if null
this is a fresh mappingnewPrefix
- new prefix. if null
this is an unmap operationuri
- uri to map prefix tojavax.jcr.RepositoryException
- if an error occursCopyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.