TJsonDeserializer.Read Method
Overloads
- TJsonDeserializer.Read(string)
- TJsonDeserializer.Read(TStream)
- TJsonDeserializer.Read(TJsonReader)
- TJsonDeserializer.Read(string, TTypeToken)
- TJsonDeserializer.Read(string, TValue, TTypeToken)
- TJsonDeserializer.Read(TStream, TTypeToken)
- TJsonDeserializer.Read(TStream, TValue, TTypeToken)
- TJsonDeserializer.Read(TJsonReader, TTypeToken)
- TJsonDeserializer.Read(TJsonReader, TValue, TTypeToken)
TJsonDeserializer.Read(string)
Deserializes a JSON string into a value of type T.
Syntax
Unit: Bcl.Json.Deserializer
function TJsonDeserializer.Read(const Json: string): T; overload;
Parameters
| <-> | Parameter | Type | Description |
|---|---|---|---|
| const | Json | string | The JSON string to deserialize. |
Returns
The deserialized value of type T.
See also
TJsonDeserializer.Read(TStream)
Deserializes JSON from a stream into a value of type T.
Syntax
Unit: Bcl.Json.Deserializer
function TJsonDeserializer.Read(Stream: TStream): T; overload;
Parameters
| <-> | Parameter | Type | Description |
|---|---|---|---|
| Stream | TStream | The stream containing JSON data. |
Returns
The deserialized value of type T.
See also
TJsonDeserializer.Read(TJsonReader)
Deserializes JSON from a TJsonReader into a value of type T.
Syntax
Unit: Bcl.Json.Deserializer
function TJsonDeserializer.Read(Reader: TJsonReader): T; overload;
Parameters
| <-> | Parameter | Type | Description |
|---|---|---|---|
| Reader | TJsonReader | The JSON reader to read from. |
Returns
The deserialized value of type T.
See also
TJsonDeserializer.Read(string, TTypeToken)
Deserializes a JSON string into a TValue using the specified type token.
Syntax
Unit: Bcl.Json.Deserializer
function TJsonDeserializer.Read(const Json: string; const ATypeToken: TTypeToken): TValue; overload;
Parameters
| <-> | Parameter | Type | Description |
|---|---|---|---|
| const | Json | string | The JSON string to deserialize. |
| const | ATypeToken | TTypeToken | The type token describing the target type. |
Returns
A TValue containing the deserialized result.
See also
TJsonDeserializer.Read(string, TValue, TTypeToken)
Deserializes a JSON string into an existing TValue.
Remarks
When the type token refers to an object type: if AValue contains an existing instance, the JSON data is merged into that instance without creating a new one. Existing properties are preserved, and properties present in the JSON override current values.
If AValue is nil, a new object instance is created and returned in AValue.
Syntax
Unit: Bcl.Json.Deserializer
procedure TJsonDeserializer.Read(const Json: string; var AValue: TValue; const ATypeToken: TTypeToken); overload;
Parameters
| <-> | Parameter | Type | Description |
|---|---|---|---|
| const | Json | string | The JSON string to deserialize. |
| var | AValue | TValue | The value to deserialize into. Can contain an existing object instance for merging. |
| const | ATypeToken | TTypeToken | The type token describing the target type. |
See also
TJsonDeserializer.Read(TStream, TTypeToken)
Deserializes JSON from a stream into a TValue using the specified type token.
Syntax
Unit: Bcl.Json.Deserializer
function TJsonDeserializer.Read(Stream: TStream; const ATypeToken: TTypeToken): TValue; overload;
Parameters
| <-> | Parameter | Type | Description |
|---|---|---|---|
| Stream | TStream | The stream containing JSON data. | |
| const | ATypeToken | TTypeToken | The type token describing the target type. |
Returns
A TValue containing the deserialized result.
See also
TJsonDeserializer.Read(TStream, TValue, TTypeToken)
Deserializes JSON from a stream into an existing TValue.
Remarks
When the type token refers to an object type: if AValue contains an existing instance, the JSON data is merged into that instance without creating a new one. Existing properties are preserved, and properties present in the JSON override current values.
If AValue is nil, a new object instance is created and returned in AValue.
Syntax
Unit: Bcl.Json.Deserializer
procedure TJsonDeserializer.Read(Stream: TStream; var AValue: TValue; const ATypeToken: TTypeToken); overload;
Parameters
| <-> | Parameter | Type | Description |
|---|---|---|---|
| Stream | TStream | The stream containing JSON data. | |
| var | AValue | TValue | The value to deserialize into. Can contain an existing object instance for merging. |
| const | ATypeToken | TTypeToken | The type token describing the target type. |
See also
TJsonDeserializer.Read(TJsonReader, TTypeToken)
Deserializes JSON from a TJsonReader into a TValue using the specified type token.
Syntax
Unit: Bcl.Json.Deserializer
function TJsonDeserializer.Read(Reader: TJsonReader; const ATypeToken: TTypeToken): TValue; overload;
Parameters
| <-> | Parameter | Type | Description |
|---|---|---|---|
| Reader | TJsonReader | The JSON reader to read from. | |
| const | ATypeToken | TTypeToken | The type token describing the target type. |
Returns
A TValue containing the deserialized result.
See also
TJsonDeserializer.Read(TJsonReader, TValue, TTypeToken)
Deserializes JSON from a TJsonReader into an existing TValue.
Remarks
When the type token refers to an object type: if AValue contains an existing instance, the JSON data is merged into that instance without creating a new one. Existing properties are preserved, and properties present in the JSON override current values.
If AValue is nil, a new object instance is created and returned in AValue.
Syntax
Unit: Bcl.Json.Deserializer
procedure TJsonDeserializer.Read(Reader: TJsonReader; var AValue: TValue; const ATypeToken: TTypeToken); overload;
Parameters
| <-> | Parameter | Type | Description |
|---|---|---|---|
| Reader | TJsonReader | The JSON reader to read from. | |
| var | AValue | TValue | The value to deserialize into. Can contain an existing object instance for merging. |
| const | ATypeToken | TTypeToken | The type token describing the target type. |