Package org.simpleframework.xml.strategy
Class ObjectValue
java.lang.Object
org.simpleframework.xml.strategy.ObjectValue
- All Implemented Interfaces:
Value
The
ObjectValue is an implementation of a value
that represents a object other than an array. Objects described
by this can be instantiated and set in to the internal graph
so that they can be later retrieved.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintThis returns zero as this is an object and will typically not be used to instantiate anything.getType()This is the type of the object instance this represents.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 set the value within this object.
-
Field Details
-
value
This is the value that has been set for this instance. -
type
This is the type that this object is used to represent.
-
-
Constructor Details
-
ObjectValue
Constructor for theObjectValueobject. This is used to describe an object that can be instantiated by the deserialization process and set on the internal graph used.- Parameters:
type- this is the type of object that is described
-
-
Method Details
-
getValue
This method is used to acquire an instance of the type that is defined by this object. If the value has not been set then this method will return null as this is not a reference. -
setValue
This method is used set the value within this object. Once this is set then thegetValuemethod will return the object that has been provided for consistency. -
getType
This is the type of the object instance this represents. The type returned by this is used to instantiate an object which will be set on this value and the internal graph maintained. -
getLength
public int getLength()This returns zero as this is an object and will typically not be used to instantiate anything. If the reference is an an array then this can not be used to instantiate it. -
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
-