Package com.topologi.diffx.sequence
Class PrefixMapping
java.lang.Object
com.topologi.diffx.sequence.PrefixMapping
Provides a mapping of namespace URIs to prefixes.
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.
- Since:
- 0.7
- Version:
- 12 May 2010
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the specified mapping if the namespace URI has not been mapped before.Returns the prefix corresponding to the given namespace URI.getURIs()Returns an enumeration of the namespace URIs used in this mapping.
-
Field Details
-
mappings
Maps namespace URIs to prefixes.
-
-
Constructor Details
-
PrefixMapping
public PrefixMapping()
-
-
Method Details
-
add
Add the specified mapping if the namespace URI has not been mapped before.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.
- Parameters:
uri- The namespace URI to map.prefix- The prefix to use.- Throws:
NullPointerException- if the URI or prefix isnull
-
getURIs
Returns an enumeration of the namespace URIs used in this mapping.- Returns:
- An enumeration of the namespace URIs used in this mapping.
-
getPrefix
Returns the prefix corresponding to the given namespace URI.- Parameters:
uri- The namespace URI to map.- Returns:
- The corresponding prefix.
-