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 NamespaceException
getPrefix
in interface NamespaceResolver
uri
- namespace URINamespaceException
- if the URI is unknown.public String getURI(String prefix) throws NamespaceException
getURI
in interface NamespaceResolver
prefix
- namespace prefixNamespaceException
- 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 NamespaceException
prefix
- prefix to mapuri
- uri to mapNamespaceException
- 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–2022 The Apache Software Foundation. All rights reserved.