Package org.simpleframework.xml.stream
Class OutputNodeMap
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<String>,Map<String,,OutputNode> SequencedMap<String,,OutputNode> NodeMap<OutputNode>
The
OutputNodeMap is used to collect attribute nodes
for an output node. This will create a generic node to add to the
map. The nodes created will be used by the output node to write
attributes for an element.-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final OutputNodeThis is the source node that this node map belongs to. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis is used to acquire theNodemapped to the given name.getName()This is used to get the name of the element that owns the nodes for the specified map.getNode()This is used to acquire the actual node this map represents.iterator()This returns an iterator for the names of all the nodes in thisOutputNodeMap.This is used to add a newNodeto the map.This is used to remove theNodemapped to the given name.Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, newLinkedHashMap, putFirst, putLast, removeEldestEntry, replaceAll, reversed, sequencedEntrySet, sequencedKeySet, sequencedValues, valuesMethods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from class java.util.AbstractMap
equals, hashCode, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from interface java.util.SequencedMap
firstEntry, lastEntry, pollFirstEntry, pollLastEntry
-
Field Details
-
source
This is the source node that this node map belongs to.
-
-
Constructor Details
-
OutputNodeMap
Constructor for theOutputNodeMapobject. This is used to create a node map that is used to create and collect nodes, which will be used as attributes for an output element.
-
-
Method Details
-
getNode
This is used to acquire the actual node this map represents. The source node provides further details on the context of the node, such as the parent name, the namespace, and even the value in the node. Care should be taken when using this.- Specified by:
getNodein interfaceNodeMap<OutputNode>- Returns:
- this returns the node that this map represents
-
getName
This is used to get the name of the element that owns the nodes for the specified map. This can be used to determine which element the node map belongs to.- Specified by:
getNamein interfaceNodeMap<OutputNode>- Returns:
- this returns the name of the owning element
-
put
This is used to add a newNodeto the map. The node that is created is a simple name value pair. Once the node is created it can be retrieved by its given name.- Specified by:
putin interfaceNodeMap<OutputNode>- Parameters:
name- this is the name of the node to be createdvalue- this is the value to be given to the node- Returns:
- this is the node that has been added to the map
-
remove
This is used to remove theNodemapped to the given name. This returns a name value pair that represents an attribute. If no node is mapped to the specified name then this method will a return null value.- Specified by:
removein interfaceNodeMap<OutputNode>- Parameters:
name- this is the name of the node to remove- Returns:
- this will return the node mapped to the given name
-
get
This is used to acquire theNodemapped to the given name. This returns a name value pair that represents an element. If no node is mapped to the specified name then this method will return a null value.- Specified by:
getin interfaceNodeMap<OutputNode>- Parameters:
name- this is the name of the node to retrieve- Returns:
- this will return the node mapped to the given name
-
iterator
This returns an iterator for the names of all the nodes in thisOutputNodeMap. This allows the names to be iterated within a for each loop in order to extract nodes.
-