Package org.simpleframework.xml.stream
Class InputNodeMap
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<String>
,Map<String,
,InputNode> SequencedMap<String,
,InputNode> NodeMap<InputNode>
The
InputNodeMap
object represents a map to contain
attributes used by an input node. This can be used as an empty
node map, it can be used to extract its values from a start
element. This creates InputAttribute
objects for
each node added to the map, these can then be used by an element
input node to represent attributes as input nodes.-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
InputNodeMap
(InputNode source) Constructor for theInputNodeMap
object.InputNodeMap
(InputNode source, EventNode element) Constructor for theInputNodeMap
object. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
This is used to insert all attributes belonging to the start element to the map.This is used to acquire theNode
mapped 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 thisNodeMap
.This is used to add a newInputAttribute
node to the map.This is used to remove theNode
mapped 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, values
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, size
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
Methods 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
-
InputNodeMap
Constructor for theInputNodeMap
object. This is used to create an empty input node map, which will createInputAttribute
object for each inserted node.- Parameters:
source
- this is the node this node map belongs to
-
InputNodeMap
Constructor for theInputNodeMap
object. This is used to create an input node map, which will be populated with the attributes from theStartElement
that is specified.- Parameters:
source
- this is the node this node map belongs toelement
- the element to populate the node map with
-
-
Method Details
-
build
This is used to insert all attributes belonging to the start element to the map. All attributes acquired from the element are converted intoInputAttribute
objects so that they can be used as input nodes by an input node.- Parameters:
element
- the element to acquire attributes from
-
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. -
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. -
put
This is used to add a newInputAttribute
node to the map. The created node can be used by an input node to to represent the attribute as another input node. Once the node is created it can be acquired using the specified name. -
remove
This is used to remove theNode
mapped 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 return a null value. -
get
This is used to acquire theNode
mapped 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 return a null value. -
iterator
This returns an iterator for the names of all the nodes in thisNodeMap
. This allows the names to be iterated within a for each loop in order to extract nodes.
-