Class JSONUtils
java.lang.Object
com.biglybt.util.JSONUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static Objectstatic MapdecodeJSON(String json) decodes JSON formatted text into a map.static StringencodeToJSON(Collection list) static StringencodeToJSON(Map map) Encodes a map into a JSON formatted string.private static JSONArrayencodeToJSONArray(Collection list) static JSONObjectencodeToJSONObject(Map map) encodes a map into a JSONObject.static void
-
Constructor Details
-
JSONUtils
public JSONUtils()
-
-
Method Details
-
decodeJSON
decodes JSON formatted text into a map.- Returns:
- Map parsed from a JSON formatted string
If the json text is not a map, a map with the key "value" will be returned. the value of "value" will either be an List, String, Number, Boolean, or null
if the String is formatted badly, null is returned
-
encodeToJSONObject
encodes a map into a JSONObject.It's recommended that you use
encodeToJSON(Map)instead- Parameters:
map-- Returns:
- Since:
- 3.0.1.5
-
encodeToJSON
-
encodeToJSON
-
coerce
-
encodeToJSONArray
- Parameters:
value-- Returns:
- Since:
- 3.0.1.5
-
main
-