org.apache.jackrabbit.core
Class NamespaceRegistryImpl

java.lang.Object
  extended byorg.apache.jackrabbit.name.AbstractNamespaceResolver
      extended byorg.apache.jackrabbit.core.NamespaceRegistryImpl
All Implemented Interfaces:
NamespaceRegistry, NamespaceResolver

public class NamespaceRegistryImpl
extends AbstractNamespaceResolver
implements NamespaceRegistry

A NamespaceRegistryImpl ...


Constructor Summary
protected NamespaceRegistryImpl(FileSystem nsRegStore)
          Protected constructor: Constructs a new instance of this class.
 
Method Summary
 String getJCRName(QName name)
          
 String getPrefix(String uri)
          
 String[] getPrefixes()
          
 QName getQName(String name)
          
 String getUniquePrefix(String uriHint)
          Returns a prefix that is unique among the already registered prefixes.
 String getURI(String prefix)
          
 String[] getURIs()
          
 void registerNamespace(String prefix, String uri)
          
 void unregisterNamespace(String prefix)
          
 
Methods inherited from class org.apache.jackrabbit.name.AbstractNamespaceResolver
addListener, notifyNamespaceAdded, notifyNamespaceRemapped, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamespaceRegistryImpl

protected NamespaceRegistryImpl(FileSystem nsRegStore)
                         throws RepositoryException
Protected constructor: Constructs a new instance of this class.

Parameters:
nsRegStore -
Throws:
RepositoryException
Method Detail

getUniquePrefix

public String getUniquePrefix(String uriHint)
Returns a prefix that is unique among the already registered prefixes.

Parameters:
uriHint - namespace uri that serves as hint for the prefix generation
Returns:
a unique prefix

registerNamespace

public void registerNamespace(String prefix,
                              String uri)
                       throws NamespaceException,
                              UnsupportedRepositoryOperationException,
                              AccessDeniedException,
                              RepositoryException

Specified by:
registerNamespace in interface NamespaceRegistry
Throws:
NamespaceException
UnsupportedRepositoryOperationException
AccessDeniedException
RepositoryException

unregisterNamespace

public void unregisterNamespace(String prefix)
                         throws NamespaceException,
                                UnsupportedRepositoryOperationException,
                                AccessDeniedException,
                                RepositoryException

Specified by:
unregisterNamespace in interface NamespaceRegistry
Throws:
NamespaceException
UnsupportedRepositoryOperationException
AccessDeniedException
RepositoryException

getPrefixes

public String[] getPrefixes()
                     throws RepositoryException

Specified by:
getPrefixes in interface NamespaceRegistry
Throws:
RepositoryException

getURIs

public String[] getURIs()
                 throws RepositoryException

Specified by:
getURIs in interface NamespaceRegistry
Throws:
RepositoryException

getURI

public String getURI(String prefix)
              throws NamespaceException

Specified by:
getURI in interface NamespaceRegistry
Throws:
NamespaceException

getPrefix

public String getPrefix(String uri)
                 throws NamespaceException

Specified by:
getPrefix in interface NamespaceRegistry
Throws:
NamespaceException

getQName

public QName getQName(String name)
               throws IllegalNameException,
                      UnknownPrefixException

Specified by:
getQName in interface NamespaceResolver
Overrides:
getQName in class AbstractNamespaceResolver
Throws:
IllegalNameException
UnknownPrefixException

getJCRName

public String getJCRName(QName name)
                  throws NoPrefixDeclaredException

Specified by:
getJCRName in interface NamespaceResolver
Overrides:
getJCRName in class AbstractNamespaceResolver
Throws:
NoPrefixDeclaredException


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