Class AdditionalNamespaceResolver
- java.lang.Object
-
- org.apache.jackrabbit.core.nodetype.xml.AdditionalNamespaceResolver
-
- All Implemented Interfaces:
NamespaceResolver
public class AdditionalNamespaceResolver extends Object implements NamespaceResolver
A simple namespace resolver implementation, that uses the additional namespaces declared in an XML element.
-
-
Constructor Summary
Constructors Constructor Description AdditionalNamespaceResolver(Properties namespaces)
Creates a namespace resolver using the namespaces defined in the given prefix-to-URI property set.AdditionalNamespaceResolver(NamespaceRegistry registry)
Creates a namespace resolver using the namespaces declared in the given namespace registry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
Constructor Detail
-
AdditionalNamespaceResolver
public AdditionalNamespaceResolver(Properties namespaces)
Creates a namespace resolver using the namespaces defined in the given prefix-to-URI property set.- Parameters:
namespaces
- namespace properties
-
AdditionalNamespaceResolver
public AdditionalNamespaceResolver(NamespaceRegistry registry) throws RepositoryException
Creates a namespace resolver using the namespaces declared in the given namespace registry.- Parameters:
registry
- namespace registry- Throws:
RepositoryException
- on repository errors
-
-
Method Detail
-
getURI
public String getURI(String prefix) throws NamespaceException
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.
-
getPrefix
public String getPrefix(String uri) throws NamespaceException
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.
-
-