util.JSONObject class

util.JSONObject class is used to modify and manipulate structured data objects according to the syntax of JSON string.

JSON object is an unordered collection of name:value pairs:

{

  "cust_num":2735,

  "cust_name":"McCarlson",

  "order_ids":[234,3456,24656,34561],

  "address": {

          "street":"34, Sunset Bld",

          "city":"Los Angeles",

          "state":"CA"

        }

}

JSON objects are enclosed in braces - { to begin the object and } to end it. Every name is followed by : (colon) and is separated from another one by , (comma):

JSON objects are created by util.JSONObject.create().

Once created, JSON objects can be studied and manipulated by util.JSONObject methods summarized in this table.

util.JSONObject.create()

creates a new JSON object

util.JSONObject.fromFGL()

creates a new JSON object from a RECORD

util.JSONObject.parse()

parses a JSON string into a new JSON object

util.JSONObject.get()

returns a value that corresponds to the specified entry name

util.JSONObject.getLength()

returns the number of the key:value pairs in the JSON object

util.JSONObject.getType()

returns the type of the element of the JSON object

util.JSONObject.has()

checks whether the JSON object includes the element with the name

util.JSONObject.getKey()

returns the key of the key:value pair by its index

util.JSONObject.getKeys()

returns a key list of a members of the JSON object

util.JSONObject.insert()

adds an element to the JSON object (= a key:value pair)

util.JSONObject.remove()

removes the specified element from the JSON object

util.JSONObject.delete()

deletes the specified element from the JSON object by its index

util.JSONObject.toFGL()

fills a RECORD with the elements of the JSON object

util.JSONObject.toString()

produces a JSON string from the values included into the JSON object

 

Contact Us

Privacy Policy

Copyright © 2025 Querix, (UK) Ltd.