API:System.JSON.TJSONObject.FindValue
Delphi
function FindValue(const APath: string): TJSONValue; override;
C++
virtual TJSONValue* __fastcall FindValue(const System::UnicodeString APath);
Propriétés
| Type | Visibilité | Source | Unité | Parent |
|---|---|---|---|---|
| function | protected | System.JSON.pas System.JSON.hpp |
System.JSON | TJSONObject |
Description
Trouve et renvoie une instance TJSONValue située dans le chemin JSON APath spécifié. Sinon, renvoie nil.
{{#multireplace:System.JSON.TJSONObject.FindValue|H21=!|H25=%|H28=(|H29=)|H2A=*|H2B=+|H2F=/|H3C=<|H3D==|H3E=>|H5B=[|H5D=]|H5E=^|H7C=|}} hérite de {{#multireplace:System.JSON.TJSONValue.FindValue|H21=!|H25=%|H28=(|H29=)|H2A=*|H2B=+|H2F=/|H3C=<|H3D==|H3E=>|H5B=[|H5D=]|H5E=^|H7C=|}}. Tout le contenu en-dessous de cette ligne se réfère à {{#multireplace:System.JSON.TJSONValue.FindValue|H21=!|H25=%|H28=(|H29=)|H2A=*|H2B=+|H2F=/|H3C=<|H3D==|H3E=>|H5B=[|H5D=]|H5E=^|H7C=|}}.
Trouve et renvoie une instance TJSONValue située dans le chemin JSON APath spécifié. Sinon, renvoie nil.
Telle qu'elle est implémentée dans la version TJSONValue en cours :
- Si
APath = '', FindValue renvoie cette instance TJSONValue. - Sinon, FindValue renvoie
nil.
Syntaxe de chemin JSON prise en charge
FindValue utilise TJSONPathParser pour analyser le chemin JSON spécifié.
TJSONPathParser implémente un sous-ensemble de la spécification de chemin JSON définie par Stefan Göessner (EN). Spécifiquement, les éléments pris en charge sont des opérateurs enfant (.) pour les objets et des opérateurs indice ([]) pour les tableaux. Ces opérateurs ne prennent pas en charge les expressions spéciales, ils supportent uniquement les valeurs réelles.
Voici un exemple de chemin JSON pris en charge par TJSONPathParser : "store.books[0].title".