Class Reference
java.lang.Object
org.simpleframework.xml.convert.Reference
- All Implemented Interfaces:
Value
The
Reference object represents a value that holds
an object instance. If an object instance is to be provided from
a Strategy implementation it must be wrapped in a
value object. The value object can then provide the details of
the instance and the actual object instance to the serializer.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintThis will return the length of an array reference.getType()This is the type of the object instance this represents.getValue()This returns the actual object instance that is held by this reference object.booleanThis will always return true as thisValueobject will always contain an object instance.voidThis is used to set the value of the object.
-
Field Details
-
value
This represents the original value returned from a strategy. -
data
This represents the object instance that this represents. -
actual
This is the actual type of the reference that is represented.
-
-
Constructor Details
-
Reference
Constructor for aReferenceobject. To create this a value and an object instance is required. The value provided may be null, but the instance should be a valid object instance to be used by the serializer.- Parameters:
value- this is the original value from a strategydata- this is the object instance that is wrappedactual- this is the overriding type of the reference
-
-
Method Details
-
getLength
-
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. -
getValue
-
isReference
public boolean isReference()This will always return true as thisValueobject will always contain an object instance. Returning true from this method tells the serializer that there is no need to actually perform any further deserialization.- Specified by:
isReferencein interfaceValue- Returns:
- this always returns true as this will be a reference
-
setValue
-