The JSONObject class

Provides an interface to handle a JSON object.

The util.JSONObject class provides methods to handle an structured data object 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.

This class is provided in the util C-Extension library; To use the util.JSONObject class, you must import the util package in your program:
IMPORT util
A JSONObject is an unordered collection of name/value pairs. The format of a JSON string is a tree of name/values wrapped in curly braces with colons between the names and values, and commas between the values and names:
{ "cust_num":2735, "cust_name":"McCarlson",
  "order_ids":[234,3456,24656,34561] }

The JSONObject class provides methods for accessing, adding/replacing or deleting the values by name with the get(), put() and remove() methods. If the structure of the JSON object is not known at compile time, you can introspect the elements of the object with the getLength(), getType() and name() methods.

A JSONObject object must be created before usage with one of the class methods like util.JSONObject.create().