Extension packages / The util package |
Provides an interface to handle a JSON array.
The util.JSONArray class provides methods to handle an array of values, following the JSON string syntax.
JSON (JavaScriptâ„¢ Object Notation) is a well known lightweight data-interchange format for JavaScript. For more details, see http://www.json.org. A JSON string (or object) is a comma-separated list of name:value pairs with the ':' character separating the key and the value. The list is enclosed in curly braces ({,}). The names are double-quoted strings.
IMPORT util
[123,546,"abc","def","xyz"]
The JSONArray class provides methods for accessing, adding/replacing or deleting the values by index with the get(), put() and remove() methods. If the structure of the JSON array is not known at compile time, you can introspect the elements of the array with the getLength() and getType() methods.
A JSONArray object must be created before usage with one of the class methods like util.JSONArray.create().