Package nxt.util
Class JSON
- java.lang.Object
-
- nxt.util.JSON
-
public final class JSON extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static org.json.simple.JSONStreamAware
emptyJSON
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
encodeObject(java.util.Map<?,?> map, java.lang.StringBuilder sb)
Create a formatted string from a mapstatic void
encodeValue(java.lang.Object value, java.lang.StringBuilder sb)
Encode a JSON valuestatic org.json.simple.JSONStreamAware
prepare(org.json.simple.JSONObject json)
static org.json.simple.JSONStreamAware
prepareRequest(org.json.simple.JSONObject json)
static java.lang.String
toJSONString(org.json.simple.JSONAware json)
Create a formatted JSON stringstatic java.lang.String
toString(org.json.simple.JSONStreamAware jsonStreamAware)
static void
writeJSONString(org.json.simple.JSONStreamAware json, java.io.Writer writer)
Write a formatted JSON string
-
-
-
Method Detail
-
prepare
public static org.json.simple.JSONStreamAware prepare(org.json.simple.JSONObject json)
-
prepareRequest
public static org.json.simple.JSONStreamAware prepareRequest(org.json.simple.JSONObject json)
-
toString
public static java.lang.String toString(org.json.simple.JSONStreamAware jsonStreamAware)
-
toJSONString
public static java.lang.String toJSONString(org.json.simple.JSONAware json)
Create a formatted JSON string- Parameters:
json
- JSON list or map- Returns:
- Formatted string
-
writeJSONString
public static void writeJSONString(org.json.simple.JSONStreamAware json, java.io.Writer writer) throws java.io.IOException
Write a formatted JSON string- Parameters:
json
- JSON list or mapwriter
- Writer- Throws:
java.io.IOException
- I/O error occurred
-
encodeObject
public static void encodeObject(java.util.Map<?,?> map, java.lang.StringBuilder sb)
Create a formatted string from a map- Parameters:
map
- Mapsb
- String builder
-
encodeValue
public static void encodeValue(java.lang.Object value, java.lang.StringBuilder sb)
Encode a JSON value- Parameters:
value
- JSON valuesb
- String builder
-
-