|
||||||||||
| 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.jcr2spi.name.LocalNamespaceMappings
public class LocalNamespaceMappings
Manager for local session namespace mappings. This class is
used by the SessionImpl class to implement
the local namespace mapping functionality required by the JCR API.
This class holds a reference to the underlying global and persistent
namespace registry (a NamespaceRegistryImpl
instance) and keeps track of local namespace mappings added by the session.
The namespace resolution methods required by the
NamespaceResolver are implemented by first
looking up the local namespace mapping and then backing to the
underlying namespace registry.
| Constructor Summary | |
|---|---|
LocalNamespaceMappings(NamespaceRegistryImpl nsReg)
Creates a local namespace manager with the given underlying namespace registry. |
|
| Method Summary | |
|---|---|
void |
dispose()
Disposes this LocalNamespaceMappings. |
Map |
getLocalNamespaceMappings()
|
String |
getPrefix(String uri)
Returns the prefix which is mapped to the given URI. |
String[] |
getPrefixes()
Returns all prefixes currently mapped. |
String |
getURI(String prefix)
Returns the URI to which the given prefix is mapped. |
void |
namespaceAdded(String prefix,
String uri)
Notifies the listeners that a new namespace uri has been
added and mapped to prefix. |
void |
namespaceRemapped(String oldPrefix,
String newPrefix,
String uri)
Notifies the listeners that an existing namespace uri has
been re-mapped from oldPrefix to newPrefix. |
void |
namespaceRemoved(String uri)
Notifies the listeners that the namespace with the given uri has been unregistered. |
void |
setNamespacePrefix(String prefix,
String uri)
Rename a persistently registered namespace URI to the new 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 |
|---|
public LocalNamespaceMappings(NamespaceRegistryImpl nsReg)
nsReg - namespace registry| Method Detail |
|---|
public void setNamespacePrefix(String prefix,
String uri)
throws NamespaceException,
RepositoryException
prefix - namespace prefixuri - namespace URI
NamespaceException
RepositoryException
public String[] getPrefixes()
throws RepositoryException
RepositoryException - if an error occurspublic void dispose()
LocalNamespaceMappings.
public Map getLocalNamespaceMappings()
public String getURI(String prefix)
throws NamespaceException
getURI in interface NamespaceResolverprefix - namespace prefix
NamespaceException - if the prefix is unknown.
public String getPrefix(String uri)
throws NamespaceException
getPrefix in interface NamespaceResolveruri - namespace URI
NamespaceException - if the URI is unknown.
public void namespaceAdded(String prefix,
String uri)
NamespaceListeneruri has been
added and mapped to prefix.
namespaceAdded in interface NamespaceListenerprefix - the prefix.uri - the namespace uri.
public void namespaceRemapped(String oldPrefix,
String newPrefix,
String uri)
NamespaceListeneruri has
been re-mapped from oldPrefix to newPrefix.
namespaceRemapped in interface NamespaceListeneroldPrefix - the old prefix.newPrefix - the new prefix.uri - the associated namespace uri.public void namespaceRemoved(String uri)
NamespaceListener
namespaceRemoved in interface NamespaceListeneruri - the namespace uri.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||