Android Programming Press on the image to return to the main documentation page.

iJSON

List of types:

JSONGenerator
JSONParser

JSONGenerator

Generates JSON strings from a Map or List containing other objects.
The generator supports maps, lists, arrays, strings and numbers.

Events:

None

Members:


  Initialize (Map As Map)

  Initialize2 (List As List)

  ToPrettyString (Indent As Int) As String

  ToString As String

Members description:

Initialize (Map As Map)
Initializes the generator with the given map.
Initialize2 (List As List)
Initializes the generator with the given list.
ToPrettyString (Indent As Int) As String
Generates a JSON string with white spaces to improve the readability.
Note that the Indent parameter is ignored (it is kept for signature compatibility).
ToString As String
Generates a compact JSON string.

JSONParser

Parses JSON formatted strings. Objects are converted to Maps and arrays are converted to Lists.
Typical code:
Dim JSON As JSONParser
JSON.Initialize(File.ReadString(File.DirAssets, "example.json"))
Dim m1 As Map = JSON.NextObject 'the whole file is parsed now

Events:

None

Members:


  Initialize (Text As String)

  NextArray As List

  NextObject As Map

Members description:

Initialize (Text As String)
Initializes the object and sets the text that will be parsed.
NextArray As List
Parses the text assuming that the top level value is an array.
NextObject As Map
Parses the text assuming that the top level value is an object.
Top