|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.jcr2spi.name.NamespaceCache
public class NamespaceCache
NamespaceCache
...
Method Summary | |
---|---|
void |
addListener(NamespaceListener listener)
Registers listener to get notifications when namespace
mappings change. |
static NamespaceCache |
getInstance(RepositoryService service)
Returns the NamespaceCache for the given RepositoryService. |
String |
getPrefix(NamespaceStorage storage,
String uri)
Returns the prefix to which the given URI is mapped |
String[] |
getPrefixes(NamespaceStorage storage)
Returns an array holding all currently registered prefixes. |
String |
getURI(NamespaceStorage storage,
String prefix)
Returns the URI to which the given prefix is mapped. |
String[] |
getURIs(NamespaceStorage storage)
Returns an array holding all currently registered URIs. |
protected void |
notifyNamespaceAdded(String prefix,
String uri)
Notifies the listeners that a new namespace uri has been
added and mapped to prefix . |
protected void |
notifyNamespaceRemapped(String oldPrefix,
String newPrefix,
String uri)
Notifies listeners that an existing namespace uri has been remapped to a new prefix. |
protected void |
notifyNamespaceRemoved(String uri)
Notifies the listeners that the namespace with the given uri
has been removed from the mapping. |
void |
registerNamespace(NamespaceStorage storage,
String prefix,
String uri)
Registers a new name space. |
void |
removeListener(NamespaceListener listener)
Removes the listener from this NamespaceRegistery . |
void |
unregisterNamespace(NamespaceStorage storage,
String prefix)
Unregisters a namespace. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static NamespaceCache getInstance(RepositoryService service) throws RepositoryException
service
- the repository service.
RepositoryException
- if an error occurs while reading from the
service.public void registerNamespace(NamespaceStorage storage, String prefix, String uri) throws NamespaceException, UnsupportedRepositoryOperationException, AccessDeniedException, RepositoryException
storage
- the underlying namespace storage.prefix
- the namespace prefix.uri
- the namespace URI.
NamespaceException
- if an illegal attempt is made to register a
mapping.
UnsupportedRepositoryOperationException
- in a level 1 implementation
AccessDeniedException
- if the session associated with the
Workspace
object through which
this registry was acquired does not have
sufficient permissions to register the
namespace.
RepositoryException
- if another error occurs.public void unregisterNamespace(NamespaceStorage storage, String prefix) throws NamespaceException, UnsupportedRepositoryOperationException, AccessDeniedException, RepositoryException
storage
- the namespace storage.prefix
- the prefix for the namespace to remove.
NamespaceException
- if an illegal attempt is made to remove a
mapping.
UnsupportedRepositoryOperationException
- in a level 1 implementation
AccessDeniedException
- if the session associated with the
Workspace
object through which
this registry was acquired does not have
sufficient permissions to unregister the
namespace.
RepositoryException
- if another error occurs.public String[] getPrefixes(NamespaceStorage storage) throws RepositoryException
storage
- the namespace storage
RepositoryException
- if an error occurs.public String[] getURIs(NamespaceStorage storage) throws RepositoryException
storage
- the namespace storage
RepositoryException
- if an error occurs.public String getURI(NamespaceStorage storage, String prefix) throws NamespaceException, RepositoryException
storage
- the namespace storage.prefix
- a string
prefix
.
NamespaceException
- if the prefix is unknown.
RepositoryException
- is another error occurspublic String getPrefix(NamespaceStorage storage, String uri) throws NamespaceException, RepositoryException
storage
- the namespace storage.uri
- a string
uri
.
NamespaceException
- if the URI is unknown.
RepositoryException
- is another error occurspublic void addListener(NamespaceListener listener)
listener
to get notifications when namespace
mappings change.
listener
- the listener to register.
UnsupportedOperationException
- if listener support is not enabled
for this AbstractNamespaceResolver
.public void removeListener(NamespaceListener listener)
listener
from this NamespaceRegistery
.
listener
- the listener to remove.
UnsupportedOperationException
- if listener support is not enabled
for this AbstractNamespaceResolver
.protected void notifyNamespaceAdded(String prefix, String uri)
uri
has been
added and mapped to prefix
.
prefix
- the prefix.uri
- the namespace uri.protected void notifyNamespaceRemapped(String oldPrefix, String newPrefix, String uri)
oldPrefix
- the old prefix.newPrefix
- the new prefix.uri
- the associated namespace uri.protected void notifyNamespaceRemoved(String uri)
uri
has been removed from the mapping.
uri
- the namespace uri.NamespaceListener.namespaceRemoved(String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |