Class Json

java.lang.Object
com.eclipsesource.json.Json

public final class Json extends Object
This class serves as the entry point to the minimal-json API.

To parse a given JSON input, use the parse() methods like in this example:

 JsonObject object = Json.parse(string).asObject();
 

To create a JSON data structure to be serialized, use the methods value(), array(), and object(). For example, the following snippet will produce the JSON string {"foo": 23, "bar": true}:

 String string = Json.object().add("foo", 23).add("bar", true).toString();
 

To create a JSON array from a given Java array, you can use one of the array() methods with varargs parameters:

 String[] names = ...
 JsonArray array = Json.array(names);