Class RegistryNamespaceResolver
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.namespace.RegistryNamespaceResolver
-
- All Implemented Interfaces:
NamespaceResolver
public class RegistryNamespaceResolver extends java.lang.Object implements NamespaceResolver
Namespace resolver based on the repository-wide namespace mappings stored in a namespace registry.
-
-
Constructor Summary
Constructors Constructor Description RegistryNamespaceResolver(NamespaceRegistry registry)
Creates a new namespace resolver based on the given namespace registry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getPrefix(java.lang.String uri)
Returns the prefix which is mapped to the given URI.java.lang.String
getURI(java.lang.String prefix)
Returns the URI to which the given prefix is mapped.
-
-
-
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 java.lang.String getPrefix(java.lang.String uri) throws NamespaceException
Description copied from interface:NamespaceResolver
Returns the prefix which is mapped to the given URI.- Specified by:
getPrefix
in interfaceNamespaceResolver
- Parameters:
uri
- namespace URI- Returns:
- the prefix mapped to the given URI.
- Throws:
NamespaceException
- if the URI is unknown.
-
getURI
public java.lang.String getURI(java.lang.String prefix) throws NamespaceException
Description copied from interface:NamespaceResolver
Returns the URI to which the given prefix is mapped.- Specified by:
getURI
in interfaceNamespaceResolver
- Parameters:
prefix
- namespace prefix- Returns:
- the namespace URI to which the given prefix is mapped.
- Throws:
NamespaceException
- if the prefix is unknown.
-
-