public final class PrefixMapping extends Object
This class can be used to reconstruct the qualified element or attribute names.
Note that for each namespace URI there can only be one prefix.
Constructor and Description |
---|
PrefixMapping() |
Modifier and Type | Method and Description |
---|---|
void |
add(String uri,
String prefix)
Add the specified mapping if the namespace URI has not been mapped before.
|
String |
getPrefix(String uri)
Returns the prefix corresponding to the given namespace URI.
|
Enumeration<String> |
getURIs()
Returns an enumeration of the namespace URIs used in this mapping.
|
public void add(String uri, String prefix) throws NullPointerException
This method will ensure that the mapping is actually unique, that is that the namespace URI correspond to one and only one prefix and that the prefix only corresponds to one and only one namespace URI.
uri
- The namespace URI to map.prefix
- The prefix to use.NullPointerException
- if the URI or prefix is null
public Enumeration<String> getURIs()
Copyright © 2007-2019. All Rights Reserved.