org.apache.jackrabbit.spi.commons.namespace
Class RegistryNamespaceResolver

java.lang.Object
  extended by org.apache.jackrabbit.spi.commons.namespace.RegistryNamespaceResolver
All Implemented Interfaces:
NamespaceResolver

public class RegistryNamespaceResolver
extends Object
implements NamespaceResolver

Namespace resolver based on the repository-wide namespace mappings stored in a namespace registry.


Constructor Summary
RegistryNamespaceResolver(NamespaceRegistry registry)
          Creates a new namespace resolver based on the given namespace registry.
 
Method Summary
 String getPrefix(String uri)
          Returns the prefix which is mapped to the given URI.
 String getURI(String prefix)
          Returns the URI to which the given prefix is mapped.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryNamespaceResolver

public RegistryNamespaceResolver(NamespaceRegistry registry)
Creates a new namespace resolver based on the given namespace registry.

Parameters:
registry - namespace registry
Method Detail

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 NamespaceResolver
Parameters:
uri - namespace URI
Returns:
the prefix mapped to the given URI.
Throws:
NamespaceException - if the URI is unknown.

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 NamespaceResolver
Parameters:
prefix - namespace prefix
Returns:
the namespace URI to which the given prefix is mapped.
Throws:
NamespaceException - if the prefix is unknown.


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