API:System.JSON.TJSONObject.FindValue
Delphi
function FindValue(const APath: string): TJSONValue; override;
C++
virtual TJSONValue* __fastcall FindValue(const System::UnicodeString APath);
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | protected | System.JSON.pas System.JSON.hpp |
System.JSON | TJSONObject |
Description
Finds and returns a TJSONValue instance located at the specified APath JSON path. Otherwise, returns nil.
{{#multireplace:System.JSON.TJSONObject.FindValue|H21=!|H25=%|H28=(|H29=)|H2A=*|H2B=+|H2F=/|H3C=<|H3D==|H3E=>|H5B=[|H5D=]|H5E=^|H7C=|}} inherits from {{#multireplace:System.JSON.TJSONValue.FindValue|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.FindValue|H21=!|H25=%|H28=(|H29=)|H2A=*|H2B=+|H2F=/|H3C=<|H3D==|H3E=>|H5B=[|H5D=]|H5E=^|H7C=|}}.
Finds and returns a TJSONValue instance located at the specified APath JSON path. Otherwise, returns nil.
As implemented in the current TJSONValue version:
- If
APath = '', FindValue returns this TJSONValue instance. - Otherwise, FindValue returns
nil.
Supported JSON Path Syntax
FindValue uses TJSONPathParser to parse the specified JSON path.
TJSONPathParser implements a subset of the JSON path specification defined by Stefan Göessner. Specifically, supported elements are child operators (.) for objects and subscript operators ([]) for arrays. These operators do not support special expressions, they only support actual values.
This is an example of a JSON path that TJSONPathParser supports: "store.books[0].title".