Package nxt.util
Class JSON
java.lang.Object
nxt.util.JSON
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidencodeObject(Map<?, ?> map, Appendable sb) Create a formatted string from a mapstatic voidencodeValue(Object value, Appendable sb) Encode a JSON valuestatic <T> Collector<T,?, org.json.simple.JSONArray> static org.json.simple.JSONStreamAwareprepare(org.json.simple.JSONObject json) static StringtoJSONString(org.json.simple.JSONAware json) Create a formatted JSON stringstatic StringtoString(org.json.simple.JSONStreamAware jsonStreamAware) static voidwriteJSONString(org.json.simple.JSONStreamAware json, Writer writer) Write a formatted JSON string
-
Field Details
-
emptyJSON
public static final org.json.simple.JSONStreamAware emptyJSON
-
-
Method Details
-
prepare
public static org.json.simple.JSONStreamAware prepare(org.json.simple.JSONObject json) -
toString
-
toJSONString
Create a formatted JSON string- Parameters:
json- JSON list or map- Returns:
- Formatted string
-
writeJSONString
public static void writeJSONString(org.json.simple.JSONStreamAware json, Writer writer) throws IOException Write a formatted JSON string- Parameters:
json- JSON list or mapwriter- Writer- Throws:
IOException- I/O error occurred
-
encodeObject
Create a formatted string from a map- Parameters:
map- Mapsb- String builder
-
encodeValue
Encode a JSON value- Parameters:
value- JSON valuesb- String builder- Throws:
IOException- I/O error occurred
-
jsonArrayCollector
-