Class Allocate
java.lang.Object
org.simpleframework.xml.strategy.Allocate
- All Implemented Interfaces:
Value
The
Allocate object is used to represent an entity
that has not yet been created and needs to be allocated to the
the object graph. This is given a map that contains each node
in the graph keyed via a unique identifier. When an instance is
created and set then it is added to the object graph.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintThis returns the length of an array if this value represents an array.getType()This is the type of the object instance that will be created and set on this value.getValue()This method is used to acquire an instance of the type that is defined by this object.booleanThis method always returns false for the default type.voidThis method is used to set the provided object in to the graph so that it can later be retrieved.
-
Field Details
-
value
This is used to create an instance of the specified type. -
key
This is the unique key that is used to store the value. -
map
This is used to store each instance in the object graph.
-
-
Constructor Details
-
Allocate
Constructor for theAllocateobject. This is used to create a value that can be used to set any object in to the internal object graph so references can be discovered.- Parameters:
value- this is the value used to describe the instancemap- this contains each instance mapped with a keykey- this is the unique key representing this instance
-
-
Method Details
-
getValue
-
setValue
This method is used to set the provided object in to the graph so that it can later be retrieved. If the key for this value is null then no object is set in the object graph. -
getType
-
getLength
public int getLength()This returns the length of an array if this value represents an array. If this does not represent an array then this will return zero. It is up to the deserialization process to determine if the annotated field or method is an array. -
isReference
public boolean isReference()This method always returns false for the default type. This is because by default all elements encountered within the XML are to be deserialized based on there XML annotations.- Specified by:
isReferencein interfaceValue- Returns:
- this returns false for each type encountered
-