API:System.JSON.TJSONArray.GetValue
Delphi
function GetValue(const Index: Integer): TJSONValue; overload;
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.
{{#multireplace:System.JSON.TJSONArray.GetValue|H21=!|H25=%|H28=(|H29=)|H2A=*|H2B=+|H2F=/|H3C=<|H3D==|H3E=>|H5B=[|H5D=]|H5E=^|H7C=|}} inherits from {{#multireplace:System.JSON.TJSONValue.GetValue|H21=!|H25=%|H28=(|H29=)|H2A=*|H2B=+|H2F=/|H3C=<|H3D==|H3E=>|H5B=[|H5D=]|H5E=^|H7C=|}}. All content below this line refers to {{#multireplace:System.JSON.TJSONValue.GetValue|H21=!|H25=%|H28=(|H29=)|H2A=*|H2B=+|H2F=/|H3C=<|H3D==|H3E=>|H5B=[|H5D=]|H5E=^|H7C=|}}.
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
APathis empty, GetValue casts this TJSONValue instance as theTtype and returns the obtained value. - If the
APathis specified and it is not empty and the GetValue version has the defaultADefaultValueparameter, then GetValue returns the specifiedADefaultValuevalue. - If the specified
APathis not empty and the GetValue version does not have the defaultADefaultValueparameter, GetValue raises an EJSONException exception, printingValue '<JSON path>' not found.