util.JSONObject methods

Methods for the util.JSONObject class.

Table 1. Class methods
Name Description
util.JSONObject.create()
  RETURNS util.JSONObject
Creates a new JSON object.
util.JSONObject.fromFGL(
   record record-type )
  RETURNS util.JSONObject
Creates a new JSON object from a RECORD.
util.JSONObject.parse(
   s STRING )
  RETURNS util.JSONObject
Parses a JSON string and creates a JSON object from it.
Table 2. Object methods
Name Description
util.JSONObject.get(
   name STRING )
  RETURNS result-type
Returns the value corresponding to the specified entry name.
util.JSONObject.getLength()
  RETURNS INTEGER
Returns the number of name-value pairs in the JSON object.
util.JSONObject.getType(
   name STRING )
  RETURNS STRING
Returns the type of a JSON object element.
util.JSONObject.has(
    name STRING )
  RETURNS BOOLEAN
Checks if the JSON object contains a specific entry name.
util.JSONObject.name(
   index INTEGER )
  RETURNS STRING
Returns the name of a JSON object entry by position.
util.JSONObject.put(
   name STRING,
   value value-type )
Sets a name-value pair in the JSON object.
util.JSONObject.remove(
   name STRING )
Removes the specified element in the JSON object.
util.JSONObject.toFGL(
  recordRef record-type )
Fills a record variable with the entries contained in the JSON object.
util.JSONObject.toString()
  RETURNS STRING
Builds a JSON string from the values contained in the JSON object.