public class JSONObject extends java.util.HashMap implements java.util.Map, JSONAware, JSONStreamAware
Constructor and Description |
---|
JSONObject() |
JSONObject(java.util.Map map)
Allows creation of a JSONObject from a Map.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
escape(java.lang.String s)
Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F).
|
java.lang.String |
toJSONString() |
static java.lang.String |
toJSONString(java.util.Map map)
Convert a map to JSON text.
|
java.lang.String |
toString() |
static java.lang.String |
toString(java.lang.String key,
java.lang.Object value)
description omitted.
|
static void |
writeJSONString(java.util.Map map,
java.io.Writer out)
Encode a map into JSON text and write it to out.
|
void |
writeJSONString(java.io.Writer out)
write JSON string to out.
|
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
public JSONObject()
public JSONObject(java.util.Map map)
map
- description omitted.public static void writeJSONString(java.util.Map map, java.io.Writer out) throws java.io.IOException
map
- description omitted.out
- description omitted.java.io.IOException
- description omitted.JSONValue.writeJSONString(Object, Writer)
public void writeJSONString(java.io.Writer out) throws java.io.IOException
JSONStreamAware
writeJSONString
in interface JSONStreamAware
out
- description omitted.java.io.IOException
- description omitted.public static java.lang.String toJSONString(java.util.Map map)
map
- description omitted.JSONValue.toJSONString(Object)
public java.lang.String toJSONString()
toJSONString
in interface JSONAware
public java.lang.String toString()
toString
in class java.util.AbstractMap
public static java.lang.String toString(java.lang.String key, java.lang.Object value)
key
- description omitted.value
- description omitted.public static java.lang.String escape(java.lang.String s)
s
- description omitted.JSONValue.escape(String)