public class NamespaceMapping extends Object implements NamespaceResolver
Constructor and Description |
---|
NamespaceMapping() |
NamespaceMapping(NamespaceResolver base)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getPrefix(String uri)
Returns the prefix which is mapped to the given URI.
|
Map<String,String> |
getPrefixToURIMapping()
Return a Map of prefix to URI mappings currently registered.
|
String |
getURI(String prefix)
Returns the URI to which the given prefix is mapped.
|
Map<String,String> |
getURIToPrefixMapping()
Return a Map of URI to prefix mappings currently registered.
|
boolean |
hasPrefix(String prefix)
Returns true if prefix is already mapped to some URI.
|
String |
removeMapping(String uri)
Clear the mapping for an URI
|
void |
setMapping(String prefix,
String uri)
Set a prefix == URI one-to-one mapping
|
String |
toString()
Override
Object.toString() |
public NamespaceMapping()
public NamespaceMapping(NamespaceResolver base)
base
- fallback resolverpublic String getPrefix(String uri) throws javax.jcr.NamespaceException
getPrefix
in interface NamespaceResolver
uri
- namespace URIjavax.jcr.NamespaceException
- if the URI is unknown.public String getURI(String prefix) throws javax.jcr.NamespaceException
getURI
in interface NamespaceResolver
prefix
- namespace prefixjavax.jcr.NamespaceException
- if the prefix is unknown.public boolean hasPrefix(String prefix)
prefix
- prefix to checktrue
if prefix is mappedpublic void setMapping(String prefix, String uri) throws javax.jcr.NamespaceException
prefix
- prefix to mapuri
- uri to mapjavax.jcr.NamespaceException
- if an error occurspublic String removeMapping(String uri)
uri
- URI to clear the mapping fornull
if it was not mapped.public Map<String,String> getPrefixToURIMapping()
public Map<String,String> getURIToPrefixMapping()
public String toString()
Object.toString()
Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.