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