org.apache.jackrabbit.core.query.lucene
Class NSRegistryBasedNamespaceMappings

java.lang.Object
  extended by org.apache.jackrabbit.spi.commons.namespace.AbstractNamespaceResolver
      extended by org.apache.jackrabbit.core.query.lucene.NSRegistryBasedNamespaceMappings
All Implemented Interfaces:
NamespaceMappings, NamespaceResolver

public class NSRegistryBasedNamespaceMappings
extends AbstractNamespaceResolver
implements NamespaceMappings

NSRegistryBasedNamespaceMappings implements a namespace mapping based on the stable index prefix provided by the 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.
 String translatePropertyName(Name qName)
          Translates a property name from a session local namespace mapping into a search index private namespace mapping.
 
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
 

Method Detail

getURI

public String getURI(String prefix)
              throws NamespaceException
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.

getPrefix

public String getPrefix(String uri)
                 throws NamespaceException
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.

translatePropertyName

public String translatePropertyName(Name qName)
                             throws IllegalNameException
Translates a property name from a session local namespace mapping into a search index private namespace mapping.

Specified by:
translatePropertyName in interface NamespaceMappings
Parameters:
qName - the property name to translate
Returns:
the translated JCR property name
Throws:
IllegalNameException


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