Package org.simpleframework.xml.core
Class ModelMap
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<ModelList>
,Map<String,
,ModelList> SequencedMap<String,
ModelList>
The
ModelMap
object represents a map that contains
string model mappings. This is used for convenience as a typedef
like construct to avoid having declare the generic type whenever
it is referenced. Also this allows ModelList
values
from the map to be iterated within for each loops.- See Also:
-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis method is used to clone the model map such that mappings can be maintained in the original even if they are modified in the clone.iterator()
This allows theModelList
objects within the model map to be iterated within for each loops.This method is used to look for aModel
that matches the specified element name.void
This is used to register aModel
within this map.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
-
detail
This is the detail associated with this model map instance.
-
-
Constructor Details
-
ModelMap
Constructor for theModelMap
object is used to create an empty map. This is used for convenience as a typedef like construct which avoids having to use the generic type.- Parameters:
detail
- this is the detail associated with the map
-
-
Method Details
-
getModels
This method is used to clone the model map such that mappings can be maintained in the original even if they are modified in the clone. This is used to that theSchema
can remove mappings from the model map as they are visited.- Returns:
- this returns a cloned representation of this map
- Throws:
Exception
-
lookup
This method is used to look for aModel
that matches the specified element name. If no such model exists then this will return null. This is as a convenient way to find a model within the tree of models being built.- Parameters:
name
- this is the name of the model to be acquiredindex
- this is the index used to order the model- Returns:
- this returns the model located by the expression
-
register
This is used to register aModel
within this map. Registration of a model creates a tree of models that can be used to represent an XML structure. Each model can contain elements and attributes associated with a type.- Parameters:
name
- this is the name of the model to be registeredmodel
- this is the model that is to be registered
-
iterator
This allows theModelList
objects within the model map to be iterated within for each loops. This will provide all remaining model objects within the map. The iteration order is not maintained so model objects may be given in any sequence.
-