org.apache.jackrabbit.name
Interface NamespaceResolver

All Known Implementing Classes:
AbstractNamespaceResolver, NamespaceMapping, SessionNamespaceResolver

Deprecated. Use the NamespaceResolver interface from the org.apache.jackrabbit.spi.commons.namespace package of the jackrabbit-spi-commons component.

public interface NamespaceResolver

Interface for resolving namespace URIs and prefixes. Unlike the JCR NamespaceRegistry interface, this interface contains no functionality other than the basic namespace URI and prefix resolution methods. This interface is therefore used internally in many places where the full namespace registry is either not available or some other mechanism is used for resolving namespaces.


Method Summary
 String getJCRName(QName qName)
          Deprecated. use NameFormat.format(QName, NamespaceResolver) instead.
 String getPrefix(String uri)
          Deprecated. Returns the prefix which is mapped to the given URI.
 QName getQName(String jcrName)
          Deprecated. use NameFormat.parse(String, NamespaceResolver) instead.
 String getURI(String prefix)
          Deprecated. Returns the URI to which the given prefix is mapped.
 

Method Detail

getURI

String getURI(String prefix)
              throws NamespaceException
Deprecated. 
Returns the URI to which the given prefix is mapped.

Parameters:
prefix - namespace prefix
Returns:
the namespace URI to which the given prefix is mapped.
Throws:
NamespaceException - if the prefix is unknown.

getPrefix

String getPrefix(String uri)
                 throws NamespaceException
Deprecated. 
Returns the prefix which is mapped to the given URI.

Parameters:
uri - namespace URI
Returns:
the prefix mapped to the given URI.
Throws:
NamespaceException - if the URI is unknown.

getQName

QName getQName(String jcrName)
               throws IllegalNameException,
                      UnknownPrefixException
Deprecated. use NameFormat.parse(String, NamespaceResolver) instead.

Parses the given prefixed JCR name into a qualified name.

Parameters:
jcrName - the raw name, potentially prefixed.
Returns:
the QName instance for the raw name.
Throws:
IllegalNameException - if the given name is not a valid JCR name
UnknownPrefixException - if the JCR name prefix does not resolve

getJCRName

String getJCRName(QName qName)
                  throws NoPrefixDeclaredException
Deprecated. use NameFormat.format(QName, NamespaceResolver) instead.

Returns the qualified name in the prefixed JCR name format.

Parameters:
qName - a qualified name
Returns:
the raw JCR name
Throws:
NoPrefixDeclaredException - if the namespace can not be resolved


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