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 AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInputNodeMap(InputNode source) Constructor for theInputNodeMapobject.InputNodeMap(InputNode source, EventNode element) Constructor for theInputNodeMapobject. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidThis is used to insert all attributes belonging to the start element to the map.This 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 thisNodeMap.This is used to add a newInputAttributenode to the map.This is used to remove theNodemapped to the given name.Methods inherited from class LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, newLinkedHashMap, putFirst, putLast, removeEldestEntry, replaceAll, reversed, sequencedEntrySet, sequencedKeySet, sequencedValues, valuesMethods inherited from class HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from class AbstractMap
equals, hashCode, toStringMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from interface SequencedMap
firstEntry, lastEntry, pollFirstEntry, pollLastEntry
-
Field Details
-
source
This is the source node that this node map belongs to.
-
-
Constructor Details
-
InputNodeMap
Constructor for theInputNodeMapobject. This is used to create an empty input node map, which will createInputAttributeobject for each inserted node.- Parameters:
source- this is the node this node map belongs to
-
InputNodeMap
Constructor for theInputNodeMapobject. This is used to create an input node map, which will be populated with the attributes from theStartElementthat 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 intoInputAttributeobjects 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
-
put
This is used to add a newInputAttributenode 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 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 return a null value. -
get
This is used to acquire 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 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.
-