parseDynamic
parseDynamic(json: StringUtf8; createdObjects: JadeAnyArray): Any;
The parseDynamic method of the JadeJson class takes a JSON string as the json parameter and generates a series of linked JadeJsonObject objects and JadeAnyArray arrays that accurately represent the passed in JSON data structure.
If the specified JSON represents:
-
A value only (for example, 5 or null), the createdObjects array is empty and the returned value is equal to the value provided in the JSON. In the case of a null value, the returned value is uninitialized.
-
An object or an array, the return value is a JadeJsonObject object or JadeJsonArray array, respectively, and represents the values in the provided JSON. This could include references to other JadeJsonObject objects or JadeAnyArray arrays that are also created. Any null values are represented by uninitialized Any primitive types.
Any objects created in this way are put inside the createdObjects array (the array is not cleared by the method). It is the responsibility of the caller to delete all objects returned from the method; for example, by calling a .purge method on the array to clean up the transient objects created.
If the specified JSON is invalid, exception 11155 (Failed to read the JSON string) is raised and the extended error text is set to a description of the error encountered during the attempt to read the JSON. No objects are created. In addition, the createdObjects array is cleared and no value is returned.
2022.0.04 and higher