Package org.simpleframework.xml.strategy
Class ObjectValue
- java.lang.Object
-
- org.simpleframework.xml.strategy.ObjectValue
-
- All Implemented Interfaces:
Value
class ObjectValue extends java.lang.Object implements Value
TheObjectValue
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:
Allocate
-
-
Constructor Summary
Constructors Constructor Description ObjectValue(java.lang.Class type)
Constructor for theObjectValue
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getLength()
This returns zero as this is an object and will typically not be used to instantiate anything.java.lang.Class
getType()
This is the type of the object instance this represents.java.lang.Object
getValue()
This method is used to acquire an instance of the type that is defined by this object.boolean
isReference()
This method always returns false for the default type.void
setValue(java.lang.Object value)
This method is used set the value within this object.
-
-
-
Constructor Detail
-
ObjectValue
public ObjectValue(java.lang.Class type)
Constructor for theObjectValue
object. 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 Detail
-
getValue
public java.lang.Object 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
public void setValue(java.lang.Object value)
This method is used set the value within this object. Once this is set then thegetValue
method will return the object that has been provided for consistency.
-
getType
public java.lang.Class 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:
isReference
in interfaceValue
- Returns:
- this returns false for each type encountered
-
-