util.JSONObject methods

Methods for the util.JSONObject class.

Table 1. Class methods
Name Description
util.JSONObject.create()
  RETURNING object util.JSONObject
Creates a new JSON object.
util.JSONObject.fromFGL(
   source RECORD )
  RETURNING object util.JSONObject
Creates a new JSON object from a RECORD.
util.JSONObject.parse(
   source STRING )
  RETURNING result util.JSONObject
Parses a JSON string and creates a JSON object from it.
Table 2. Object methods
Name Description
util.JSONObject.get(
   name STRING )
  RETURNING result result-type
Returns the value corresponding to the specified entry name.
util.JSONObject.getLength()
  RETURNING len INTEGER
Returns the number of name-value pairs in the JSON object.
util.JSONObject.getType(
   name STRING )
  RETURNING type STRING
Returns the type of a JSON object element.
util.JSONObject.has(
   name STRING )
  RETURNING result BOOLEAN
Checks if the JSON object contains a specific entry name.
util.JSONObject.name(
   index INTEGER )
  RETURNING result 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(
  dest RECORD )
Fills a record variable with the entries contained in the JSON object.
util.JSONObject.toString()
  RETURNING result STRING
Builds a JSON string from the values contained in the JSON object.