org.apache.jackrabbit.jcr2spi.name
Class NamespaceRegistryImpl

java.lang.Object
  extended by org.apache.jackrabbit.spi.commons.namespace.AbstractNamespaceResolver
      extended by org.apache.jackrabbit.jcr2spi.name.NamespaceRegistryImpl
All Implemented Interfaces:
NamespaceRegistry, NamespaceResolver

public class NamespaceRegistryImpl
extends AbstractNamespaceResolver
implements NamespaceRegistry

NamespaceRegistryImpl implements the JCR client facing NamespaceRegistry.


Constructor Summary
NamespaceRegistryImpl(NamespaceStorage storage, NamespaceCache nsCache)
          Create a new NamespaceRegistryImpl.
 
Method Summary
 void addListener(NamespaceListener listener)
          Register on NamespaceCache.
 String getPrefix(String uri)
          Returns the prefix which is mapped to the given URI.
 String[] getPrefixes()
           
 String getURI(String prefix)
          Returns the URI to which the given prefix is mapped.
 String[] getURIs()
           
 void registerNamespace(String prefix, String uri)
           
 void removeListener(NamespaceListener listener)
          Unregister on NamespaceCache.
 void unregisterNamespace(String prefix)
           
 
Methods inherited from class org.apache.jackrabbit.spi.commons.namespace.AbstractNamespaceResolver
notifyNamespaceAdded, notifyNamespaceRemapped, notifyNamespaceRemoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamespaceRegistryImpl

public NamespaceRegistryImpl(NamespaceStorage storage,
                             NamespaceCache nsCache)
Create a new NamespaceRegistryImpl.

Parameters:
storage -
pathFactory -
Method Detail

registerNamespace

public void registerNamespace(String prefix,
                              String uri)
                       throws NamespaceException,
                              UnsupportedRepositoryOperationException,
                              RepositoryException
Specified by:
registerNamespace in interface NamespaceRegistry
Throws:
NamespaceException
UnsupportedRepositoryOperationException
RepositoryException
See Also:
NamespaceRegistry.registerNamespace(String, String)

unregisterNamespace

public void unregisterNamespace(String prefix)
                         throws NamespaceException,
                                UnsupportedRepositoryOperationException,
                                RepositoryException
Specified by:
unregisterNamespace in interface NamespaceRegistry
Throws:
NamespaceException
UnsupportedRepositoryOperationException
RepositoryException
See Also:
NamespaceRegistry.unregisterNamespace(String)

getPrefixes

public String[] getPrefixes()
                     throws RepositoryException
Specified by:
getPrefixes in interface NamespaceRegistry
Throws:
RepositoryException
See Also:
NamespaceRegistry.getPrefixes()

getURIs

public String[] getURIs()
                 throws RepositoryException
Specified by:
getURIs in interface NamespaceRegistry
Throws:
RepositoryException
See Also:
NamespaceRegistry.getURIs()

getURI

public String getURI(String prefix)
              throws NamespaceException
Description copied from interface: NamespaceResolver
Returns the URI to which the given prefix is mapped.

Specified by:
getURI in interface NamespaceRegistry
Specified by:
getURI in interface NamespaceResolver
Parameters:
prefix - namespace prefix
Returns:
the namespace URI to which the given prefix is mapped.
Throws:
NamespaceException - if the prefix is unknown.
See Also:
NamespaceRegistry.getURI(String), NamespaceResolver.getURI(String)

getPrefix

public String getPrefix(String uri)
                 throws NamespaceException
Description copied from interface: NamespaceResolver
Returns the prefix which is mapped to the given URI.

Specified by:
getPrefix in interface NamespaceRegistry
Specified by:
getPrefix in interface NamespaceResolver
Parameters:
uri - namespace URI
Returns:
the prefix mapped to the given URI.
Throws:
NamespaceException - if the URI is unknown.
See Also:
NamespaceRegistry.getPrefix(String), NamespaceResolver.getPrefix(String)

removeListener

public void removeListener(NamespaceListener listener)
Unregister on NamespaceCache.

Overrides:
removeListener in class AbstractNamespaceResolver
Parameters:
listener - the namespace listener.

addListener

public void addListener(NamespaceListener listener)
Register on NamespaceCache.

Overrides:
addListener in class AbstractNamespaceResolver
Parameters:
listener - the namespace listener.


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.