Class SessionNamespaceResolver
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.namespace.SessionNamespaceResolver
-
- All Implemented Interfaces:
NamespaceResolver
public class SessionNamespaceResolver extends Object implements NamespaceResolver
helper class that exposes theNamespaceResolverinterface on aSession.
-
-
Constructor Summary
Constructors Constructor Description SessionNamespaceResolver(Session session)Creates a new namespace resolver based on a session
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetPrefix(String uri)Returns the prefix which is mapped to the given URI.StringgetURI(String prefix)Returns the URI to which the given prefix is mapped.
-
-
-
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.- Specified by:
getPrefixin interfaceNamespaceResolver- 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.- Specified by:
getURIin interfaceNamespaceResolver- Parameters:
prefix- namespace prefix- Returns:
- the namespace URI to which the given prefix is mapped.
- Throws:
NamespaceException- if the prefix is unknown.
-
-