JSONGenerator object

The JSONGenerator object provides the ability to construct the JSON objects with the root item being either an object or an array. It supports adding values, objects, or arrays to the constructed JSON object.

Note

It is not supported to use this object to process large data (20 MB or 100,000 data rows can be considered as large data based on our tests), because this object will call a third-party library which is memory intensive.

Note

JSONGenerator (as well as HTTPClient, RESTClient, CrypterObject, CoderObject, CompressorObject, DotNetAssembly, JSONParser, JSONPackage, OAuthClient, PDF Builder objects, SMTPClient, PowerServerLabel, PowerServerResult) does not support multi-threading.

Properties

JSONGenerator property

Datatype

Description

ClassDefinition

PowerObject

An object of type PowerObject containing information about the class definition of the object or control.


Events

JSONGenerator event

Occurs

Constructor

Immediately before the Open event occurs in the window

Destructor

Immediately after the Close event occurs in the window


Functions

JSONGenerator function

Datatype returned

Description

AddItemArray

Long

Adds a child item of JSONArrayItem type.

AddItemBlob

Long

Adds a child item of JSONStringItem type.

AddItemBoolean

Long

Adds a child item of JSONBooleanItem type.

AddItemDate

Long

Adds a child item of JSONStringItem type.

AddItemDateTime

Long

Adds a child item of JSONStringItem or JSONNumberItem type.

AddItemNull

Long

Adds a child item of JSONNullItem type.

AddItemNumber

Long

Adds a child item of JSONNumberItem type.

AddItemObject

Long

Adds a child item of JSONObjectItem type.

AddItemString

Long

Adds a child item of JSONStringItem type.

AddItemTime

Long

Adds a child item of JSONStringItem type.

ClassName

String

Returns the name assigned to the object.

CreateJSONArray

Long

Creates an array as root item to initialize instance.

CreateJSONObject

Long

Creates an object as root item to initialize instance.

GetContextService

Integer

Creates a reference to a context-specific instance of the specified service.

GetJSONBlob

Blob

Gets the JSON blob data.

GetJSONString

String

Gets the JSON string data.

GetItemByPath

Long

Gets the handle of the item.

GetPathByItem

String

Gets the path of the item.

GetParent

PowerObject

Returns a reference to the name of the parent object.

ImportString

Long

Imports a JsonObjectItem item from a JSON string.

ImportFile

Long

Imports a JsonObjectItem item from a JSON file.

PostEvent

Boolean

Adds an event to the end of the message queue for the object.

SaveToFile

Integer

Saves the JSON data to the local file.

TriggerEvent

Integer

Triggers a specific event in the object and executes the script for the event.

TypeOf

Object

Returns the type of the object.