Class NamespaceMapping
java.lang.Object
org.apache.jackrabbit.spi.commons.namespace.NamespaceMapping
- All Implemented Interfaces:
NamespaceResolver
A Simple Namespace Mapping table. Mappings can be added
and then the object can be used as a NamespaceResolver. Additionally, it can
be based on a underlying NamespaceResolver
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the prefix which is mapped to the given URI.Return a Map of prefix to URI mappings currently registered.Returns the URI to which the given prefix is mapped.Return a Map of URI to prefix mappings currently registered.booleanReturns true if prefix is already mapped to some URI.removeMapping(String uri) Clear the mapping for an URIvoidsetMapping(String prefix, String uri) Set a prefix == URI one-to-one mappingtoString()OverrideObject.toString()
-
Constructor Details
-
NamespaceMapping
public NamespaceMapping() -
NamespaceMapping
Constructor- Parameters:
base- fallback resolver
-
-
Method Details
-
getPrefix
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
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.
-
hasPrefix
Returns true if prefix is already mapped to some URI. Returns false otherwise.- Parameters:
prefix- prefix to check- Returns:
trueif prefix is mapped
-
setMapping
Set a prefix == URI one-to-one mapping- Parameters:
prefix- prefix to mapuri- uri to map- Throws:
NamespaceException- if an error occurs
-
removeMapping
Clear the mapping for an URI- Parameters:
uri- URI to clear the mapping for- Returns:
- The prefix the URI was mapped to or
nullif it was not mapped.
-
getPrefixToURIMapping
Return a Map of prefix to URI mappings currently registered. The returned Map is a copy of the internal Map.- Returns:
- Map
-
getURIToPrefixMapping
Return a Map of URI to prefix mappings currently registered. The returned Map is a copy of the internal Map.- Returns:
- Map
-
equals
-
toString
OverrideObject.toString()
-