|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.spi.commons.namespace.AbstractNamespaceResolver
org.apache.jackrabbit.core.NamespaceRegistryImpl
public class NamespaceRegistryImpl
A NamespaceRegistryImpl
...
Constructor Summary | |
---|---|
protected |
NamespaceRegistryImpl(FileSystem nsRegStore)
Protected constructor: Constructs a new instance of this class. |
Method Summary | |
---|---|
void |
externalRemap(String oldPrefix,
String newPrefix,
String uri)
Called when a namespace has been externally remapped. |
NameResolver |
getNameResolver()
|
PathResolver |
getPathResolver()
|
String |
getPrefix(String uri)
Returns the prefix which is mapped to the given URI. |
String[] |
getPrefixes()
|
String |
getUniquePrefix(String uriHint)
Returns a prefix that is unique among the already registered prefixes. |
String |
getURI(int idx)
Returns the URI for a given index (i.e. |
String |
getURI(String prefix)
Returns the URI to which the given prefix is mapped. |
int |
getURIIndex(String uri)
Returns the index (i.e. |
String[] |
getURIs()
|
void |
registerNamespace(String prefix,
String uri)
|
void |
safeRegisterNamespace(String prefixHint,
String uri)
Registers a namespace using the given prefix hint. |
void |
setEventChannel(NamespaceEventChannel eventChannel)
Set an event channel to inform about changes. |
void |
unregisterNamespace(String prefix)
|
Methods inherited from class org.apache.jackrabbit.spi.commons.namespace.AbstractNamespaceResolver |
---|
addListener, notifyNamespaceAdded, notifyNamespaceRemapped, notifyNamespaceRemoved, removeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected NamespaceRegistryImpl(FileSystem nsRegStore) throws RepositoryException
nsRegStore
-
RepositoryException
Method Detail |
---|
public NameResolver getNameResolver()
public PathResolver getPathResolver()
public String getUniquePrefix(String uriHint)
uriHint
- namespace uri that serves as hint for the prefix generation
public void safeRegisterNamespace(String prefixHint, String uri) throws NamespaceException, RepositoryException
prefixHint
- the prefix hinturi
- the namespace URI
NamespaceException
- if an illegal attempt is made to register
a mapping
RepositoryException
- if an unexpected error occursregisterNamespace(String, String)
public void setEventChannel(NamespaceEventChannel eventChannel)
eventChannel
- event channelpublic int getURIIndex(String uri) throws NamespaceException
uri
- the uri to retrieve the index for
NamespaceException
- if the URI is not registered.public String getURI(int idx) throws NamespaceException
idx
- the index to retrieve the uri for.
NamespaceException
- if the URI is not registered.public void registerNamespace(String prefix, String uri) throws NamespaceException, UnsupportedRepositoryOperationException, AccessDeniedException, RepositoryException
registerNamespace
in interface NamespaceRegistry
NamespaceException
UnsupportedRepositoryOperationException
AccessDeniedException
RepositoryException
public void unregisterNamespace(String prefix) throws NamespaceException, UnsupportedRepositoryOperationException, AccessDeniedException, RepositoryException
unregisterNamespace
in interface NamespaceRegistry
NamespaceException
UnsupportedRepositoryOperationException
AccessDeniedException
RepositoryException
public String[] getPrefixes() throws RepositoryException
getPrefixes
in interface NamespaceRegistry
RepositoryException
public String[] getURIs() throws RepositoryException
getURIs
in interface NamespaceRegistry
RepositoryException
public String getURI(String prefix) throws NamespaceException
getURI
in interface NamespaceRegistry
getURI
in interface NamespaceResolver
prefix
- namespace prefix
NamespaceException
- if the prefix is unknown.public String getPrefix(String uri) throws NamespaceException
getPrefix
in interface NamespaceRegistry
getPrefix
in interface NamespaceResolver
uri
- namespace URI
NamespaceException
- if the URI is unknown.public void externalRemap(String oldPrefix, String newPrefix, String uri) throws 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 to
RepositoryException
- if an error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |