Package net.sf.saxon.om
Class NamespaceDeltaMap
- java.lang.Object
-
- net.sf.saxon.om.NamespaceMap
-
- net.sf.saxon.om.NamespaceDeltaMap
-
- All Implemented Interfaces:
java.lang.Iterable<NamespaceBinding>
,NamespaceBindingSet
,NamespaceResolver
public class NamespaceDeltaMap extends NamespaceMap implements NamespaceBindingSet, NamespaceResolver
Holds a set of namespace bindings as a simple immutable map from prefixes to URIs.A NamespaceMap never physically contains a binding for the XML namespace, but some interfaces behave as if it did.
The map may or may not contain a binding for the default namespace, represented by the prefix "" (zero-length string)
The map must not contain any namespace undeclarations: that is, the namespace will never be "" (zero-length string)
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.om.NamespaceMap
prefixes, uris
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allowsNamespaceUndeclarations()
static NamespaceDeltaMap
emptyMap()
Get a namespace map containing no namespace bindingsprotected NamespaceMap
makeNamespaceMap()
NamespaceDeltaMap
put(java.lang.String prefix, NamespaceUri uri)
Add a new entry to the map, or replace an existing entry.NamespaceDeltaMap
remove(java.lang.String prefix)
Remove an entry from the map-
Methods inherited from class net.sf.saxon.om.NamespaceMap
addAll, applyDifferences, bind, equals, fromNamespaceResolver, getDefaultNamespace, getDifferences, getNamespaceBindings, getNamespaceUri, getPrefixArray, getURIForPrefix, getURIsAsArray, hashCode, isEmpty, iteratePrefixes, iterator, of, putAll, size, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.om.NamespaceBindingSet
getNamespaceUri
-
Methods inherited from interface net.sf.saxon.om.NamespaceResolver
getURIForPrefix, iteratePrefixes
-
-
-
-
Method Detail
-
emptyMap
public static NamespaceDeltaMap emptyMap()
Get a namespace map containing no namespace bindings- Returns:
- an empty namespace map
-
makeNamespaceMap
protected NamespaceMap makeNamespaceMap()
- Overrides:
makeNamespaceMap
in classNamespaceMap
-
allowsNamespaceUndeclarations
public boolean allowsNamespaceUndeclarations()
- Overrides:
allowsNamespaceUndeclarations
in classNamespaceMap
-
put
public NamespaceDeltaMap put(java.lang.String prefix, NamespaceUri uri)
Description copied from class:NamespaceMap
Add a new entry to the map, or replace an existing entry. An attempt to add a binding of the "xml" prefix to the XML namespace is silently ignored.- Overrides:
put
in classNamespaceMap
- Parameters:
prefix
- the prefix whose entry is to be added or replaced. May be zero-length to represent the default namespaceuri
- the URI to be associated with this prefix; if zero-length or null, any existing mapping for the prefix is removed.- Returns:
- a new map containing the added or replaced entry (or this map, unchanged, if the prefix-uri mapping was already present in the old map).
-
remove
public NamespaceDeltaMap remove(java.lang.String prefix)
Description copied from class:NamespaceMap
Remove an entry from the map- Overrides:
remove
in classNamespaceMap
- Parameters:
prefix
- the entry to be removed from the map- Returns:
- a new map in which the relevant entry has been removed, or this map (unchanged) if the requested entry was not present
-
-