JsonConverter

json.ql

Constructor Overview

Constructor Description
JsonConverter(_gson, prettyPrint)

Function Overview

Function Description
native static fun createJsonConverter(prettyPrint) Creates a JsonConverter with the pretty print option.
native fun toJson(obj) Converts an object to a JSON string.
native fun fromJson(str) Converts a JSON string to an object.

Constructors

JsonConverter(_gson, prettyPrint) link

Functions

native static fun createJsonConverter(prettyPrint) link

Creates a JsonConverter with the pretty print option.

Params
prettyPrint ( boolean )

If the JSON should be pretty printed when deserialized

Returns JsonConverter

The created JsonConverter

json:json.ql
native fun toJson(obj) link

Converts an object to a JSON string.

Params
obj

The object to convert to JSON, of any type

Returns string

The JSON string

json:json.ql
native fun fromJson(str) link

Converts a JSON string to an object.

Params
str ( string )

The JSON string to convert to an object

Returns

The object from the JSON string, of any type

json:json.ql