Summary

Value method allows to de-serialize typed data value. Both, simple types, such as Integer or string, and complex types, such as records, objects or arrays can be de-serialized using Value method.

Syntax

function Value<T>: T; overload;

Type Parameters

T
Specifies type of de-serializing value.

Return Value

Type: T

De-serialized value.

Remarks

Value method can be used to read typed data values. It can be called in the following de-serializer states:

The algorithm, which is used to serialize and de-serialize typed values, depends of its type. Serialization engine provides built-in support for many Delphi types. For example, an array is serialized by writing all its elements; record or object is serialized by writing all its public fields and properties. However, there are exist some possibilities to change the way in which typed values will be serialized (Look at TSerializer.Value  method description). In such cases de-serialization way should be changed accordingly.

Note:

There are two overloaded Value methods. This one implements normal read mode, as opposed to fill-read mode, which is implemented in another overload. To learn more about read modes, look at NG.Serialization.FillReadAttribute description.

Examples

DelphiCopyCode imageCopy Code
str  := D.Value<string>;
i    := D.Value<Integer>;
cust := D.Value<TMyCustomer>;