public interface NamespaceMap extends Iterable<String>
NamespaceMap
object is used store the namespaces
for an element. Each namespace added to this map can be added
with a prefix. A prefix is added only if the associated reference
has not been added to a parent element. If a parent element has
the associated reference, then the parents prefix is the one that
will be returned when requested from this map.Modifier and Type | Method and Description |
---|---|
String |
getPrefix()
This is the prefix that is associated with the source element.
|
String |
getPrefix(String reference)
This acquires the prefix for the specified namespace reference.
|
String |
getReference(String prefix)
This acquires the namespace reference for the specified prefix.
|
Iterator<String> |
iterator()
This returns an iterator for the namespace of all the nodes
in this
NamespaceMap . |
String |
setReference(String reference)
This is used to add the namespace reference to the namespace
map.
|
String |
setReference(String reference,
String prefix)
This is used to add the namespace reference to the namespace
map.
|
forEach, spliterator
String getPrefix()
String getPrefix(String reference)
reference
- the reference to find a matching prefix forString getReference(String prefix)
prefix
- the prefix to find a matching reference forIterator<String> iterator()
NamespaceMap
. This allows the namespaces
to be iterated within a for each loop in order to extract the
prefix values associated with the map.String setReference(String reference)
reference
- this is the reference to be addedString setReference(String reference, String prefix)
reference
- this is the reference to be addedprefix
- this is the prefix to be added to the reference