The JSONParser object provides the ability to load the JSON-formatted data from a string or from a TXT file into a JSON object, and then parse the JSON object to get the child item count, get the handle, key name or value of any specified item, etc.
Note
This object cannot be referenced in .NET Web Service or .NET Assembly components, otherwise the component will fail to be deployed.
JSONParser property |
Datatype |
Description |
---|---|---|
ClassDefinition |
PowerObject |
An object of type PowerObject containing information about the class definition of the object or control. |
Boolean |
Specifies whether the getting item function returns a null value when error occurs. |
JSONParser event |
Occurs |
---|---|
Immediately before the Open event occurs in the window |
|
Immediately after the Close event occurs in the window |
JSONParser function |
Datatype returned |
Description |
---|---|---|
String |
Returns the name assigned to the object. |
|
Boolean |
Checks if the key name exists. |
|
Long |
Gets the child item count. |
|
Long |
Gets the child item handle. |
|
String |
Gets the key name of child item. |
|
Integer |
Creates a reference to a context-specific instance of the specified service. |
|
Long |
Gets the handle value of the child array item. |
|
Blob |
Gets the blob value of the item. |
|
Boolean |
Gets the boolean value of the item. |
|
Date |
Gets the date value of the item. |
|
DateTime |
Gets the datetime value of the item. |
|
Double |
Gets the double value of the item. |
|
Long |
Gets the handle value of the child object item. |
|
String |
Gets the string value of the item. |
|
Time |
Gets the time value of the item. |
|
JSONItemType (enumerated) |
Gets the type of item. Values are: JsonStringItem! -- Type of the JSON node whose key value pair is a string, such as "name":"evan". JsonNumberItem! -- Type of the JSON node whose key value pair is a number, such as "id":1001. JsonBooleanItem! -- Type of the JSON node whose key value pair is a boolean, such as "active":true. JsonNullItem! -- Type of the JSON node whose key value pair is null, such as "remark": null. JsonObjectItem! -- Type of the JSON node whose key value pair is an object, such as "date_object":{"datetime":7234930293, "date": "2017-09-21", "time": "12:00:00"}. JsonArrayItem! -- Type of the JSON node whose key value pair is an array, such as "department_array":[999999, {"name":"Website"}, {"name":"PowerBuilder"}, {"name":"IT"}]. |
|
PowerObject |
Returns a reference to the name of the parent object. |
|
Long |
Gets the root item handle. |
|
String |
Loads a JSON file. The JSON file cannot contain special characters such as ~r~n or ~t, otherwise, LoadFile will throw the error "Invalid encoding in string". |
|
String |
Loads a JSON string. The JSON string cannot contain special characters such as ~r~n or ~t, otherwise, LoadString will throw the error "Invalid encoding in string". |
|
Boolean |
Adds an event to the end of the message queue for the object. |
|
Integer |
Triggers a specific event in the object and executes the script for the event. |
|
Object |
Returns the type of the object. |