API:System.JSON.TJSONArray.GetValue
Delphi
function GetValue(const Index: Integer): TJSONValue; overload; inline;
C++
HIDESBASE TJSONValue* __fastcall GetValue(const int Index)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | protected | System.JSON.pas System.JSON.hpp |
System.JSON | TJSONArray |
Description
Finds a TJSONValue object located at the specified APath
JSON path, casts this JSON value as the T
JSON type and returns this value. Otherwise, returns ADefaultValue
.
System.JSON.TJSONArray.GetValue inherits from System.JSON.TJSONValue.GetValue. All content below this line refers to System.JSON.TJSONValue.GetValue.
Finds a TJSONValue object located at the specified APath
JSON path, casts this JSON value as the T
JSON type and returns this value. Otherwise, returns ADefaultValue
.
If GetValue unable to find a TJSONValue object located at the specified APath
JSON path and GetValue does not specify a ADefaultValue
parameter, then GetValue raises an EJSONException exception.
In the current version, TJSONValue implements the following functionality:
- If the specified
APath
is empty, GetValue casts this TJSONValue instance as theT
type and returns the obtained value. - If the
APath
is specified and it is not empty and the GetValue version has the defaultADefaultValue
parameter, then GetValue returns the specifiedADefaultValue
value. - If the specified
APath
is not empty and the GetValue version does not have the defaultADefaultValue
parameter, GetValue raises an EJSONException exception, printingValue '<JSON path>' not found
.