org.apache.jackrabbit.name
Class SessionNamespaceResolver

java.lang.Object
  extended byorg.apache.jackrabbit.name.AbstractNamespaceResolver
      extended byorg.apache.jackrabbit.name.SessionNamespaceResolver
All Implemented Interfaces:
NamespaceResolver

public class SessionNamespaceResolver
extends AbstractNamespaceResolver

helper class that exposes the NamespaceResolver interface on a Session


Constructor Summary
SessionNamespaceResolver(Session session)
          Creates a new namespace resolver based on a session
 
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 org.apache.jackrabbit.name.AbstractNamespaceResolver
addListener, getJCRName, getQName, notifyNamespaceAdded, notifyNamespaceRemapped, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionNamespaceResolver

public SessionNamespaceResolver(Session session)
Creates a new namespace resolver based on a session

Parameters:
session -
Method Detail

getPrefix

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

getURI

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


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