Package org.simpleframework.xml.strategy
Class ReadGraph
java.lang.Object
java.util.AbstractMap
java.util.HashMap
org.simpleframework.xml.strategy.ReadGraph
- All Implemented Interfaces:
Serializable
,Cloneable
,Map
The
ReadGraph
object is used to build a graph of the
objects that have been deserialized from the XML document. This is
required so that cycles in the object graph can be recreated such
that the deserialized object is an exact duplicate of the object
that was serialized. Objects are stored in the graph using unique
keys, which for this implementation are unique strings.- See Also:
-
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 String
This is the label used to mark the type of an object.private final String
This is used to represent the length of array object values.private final Loader
This is the class loader that is used to load the types used.private final String
This is the attribute used to mark the identity of an object.private final String
This is the attribute used to refer to an existing instance. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis is used to recover the object references from the document using the special attributes specified.private Value
This is used to acquire theValue
which can be used to represent the deserialized value.private Value
readInstance
(Type type, Class real, NodeMap node) This is used to recover the object references from the document using the special attributes specified.private Value
readReference
(Type type, Class real, NodeMap node) This is used to recover the object references from the document using the special attributes specified.private Value
This is used to acquire theValue
which can be used to represent the deserialized value.private Value
This is used to acquire theValue
which can be used to represent the deserialized value.Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Field Details
-
loader
This is the class loader that is used to load the types used. -
length
This is used to represent the length of array object values. -
label
This is the label used to mark the type of an object. -
mark
This is the attribute used to mark the identity of an object. -
refer
This is the attribute used to refer to an existing instance.
-
-
Constructor Details
-
ReadGraph
Constructor for theReadGraph
object. This is used to create graphs that are used for reading objects from the XML document. The specified strategy is used to acquire the names of the special attributes used during the serialization.- Parameters:
contract
- this is the name scheme used by the strategyloader
- this is the class loader to used for the graph
-
-
Method Details
-
read
This is used to recover the object references from the document using the special attributes specified. This allows the element specified by theNodeMap
to be used to discover exactly which node in the object graph the element represents.- Parameters:
type
- the type of the field or method in the instancenode
- this is the XML element to be deserialized- Returns:
- this is used to return the type to acquire the value
- Throws:
Exception
-
readInstance
This is used to recover the object references from the document using the special attributes specified. This allows the element specified by theNodeMap
to be used to discover exactly which node in the object graph the element represents.- Parameters:
type
- the type of the field or method in the instancereal
- this is the overridden type from the XML elementnode
- this is the XML element to be deserialized- Returns:
- this is used to return the type to acquire the value
- Throws:
Exception
-
readReference
This is used to recover the object references from the document using the special attributes specified. This allows the element specified by theNodeMap
to be used to discover exactly which node in the object graph the element represents.- Parameters:
type
- the type of the field or method in the instancereal
- this is the overridden type from the XML elementnode
- this is the XML element to be deserialized- Returns:
- this is used to return the type to acquire the value
- Throws:
Exception
-
readValue
This is used to acquire theValue
which can be used to represent the deserialized value. The type create cab be added to the graph of created instances if the XML element has an identification attribute, this allows cycles to be completed.- Parameters:
type
- the type of the field or method in the instancereal
- this is the overridden type from the XML elementnode
- this is the XML element to be deserialized- Returns:
- this is used to return the type to acquire the value
- Throws:
Exception
-
readValue
This is used to acquire theValue
which can be used to represent the deserialized value. The type create cab be added to the graph of created instances if the XML element has an identification attribute, this allows cycles to be completed.- Parameters:
type
- the type of the field or method in the instancereal
- this is the overridden type from the XML elementnode
- this is the XML element to be deserializedkey
- the key the instance is known as in the graph- Returns:
- this is used to return the type to acquire the value
- Throws:
Exception
-
readArray
This is used to acquire theValue
which can be used to represent the deserialized value. The type create cab be added to the graph of created instances if the XML element has an identification attribute, this allows cycles to be completed.- Parameters:
type
- the type of the field or method in the instancereal
- this is the overridden type from the XML elementnode
- this is the XML element to be deserialized- Returns:
- this is used to return the type to acquire the value
- Throws:
Exception
-