Skip to content
This repository was archived by the owner on May 28, 2022. It is now read-only.
Redstonecrafter0 edited this page Jan 25, 2021 · 1 revision

json-simple

pretty-print

The RedstoneAPI provides a fork of json-simple that provides pretty printing on JSONObject and JSONArray of Gson.

JSONObject obj = new JSONObject();
String prettyObjectString = obj.toPrettyJsonString();
JSONArray arr = new JSONArray();
String prettyArrayString = arr.toPrettyJsonString();

get-values

To get the values of the JSONArray and JSONObject it is now possible to instead of casting every value directly get the wanted object. Here is an example for getting a String.

JSONObject obj = new JSONObject();
obj.put("test", "test");
String text = obj.getString("test);
Clone this wiki locally