java.lang.Object | |||
↳ | java.util.AbstractMap<K, V> | ||
↳ | java.util.HashMap<K, V> | ||
↳ | com.pnfsoftware.jeb.util.encoding.json.JSONObject |
A JSON object. Key value pairs are unordered. JSONObject supports java.util.Map interface.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
JSONObject() | |||||||||||
JSONObject(Map map)
Allows creation of a JSONObject from a Map.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static String |
escape(String s)
Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F).
| ||||||||||
static String |
toJSONString(Map map)
Convert a map to JSON text.
| ||||||||||
String | toJSONString() | ||||||||||
static String | toString(String key, Object value) | ||||||||||
String | toString() | ||||||||||
void |
writeJSONString(Writer out)
write JSON string to out.
| ||||||||||
static void |
writeJSONString(Map map, Writer out)
Encode a map into JSON text and write it to out.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.util.HashMap
| |||||||||||
From class
java.util.AbstractMap
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.pnfsoftware.jeb.util.encoding.json.JSONAware
| |||||||||||
From interface
com.pnfsoftware.jeb.util.encoding.json.JSONStreamAware
| |||||||||||
From interface
java.util.Map
|
Allows creation of a JSONObject from a Map. After that, both the generated JSONObject and the Map can be modified independently.
Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F). It's the same as JSONValue.escape() only for compatibility here.
Convert a map to JSON text. The result is a JSON object. If this map is also a JSONAware, JSONAware specific behaviours will be omitted at this top level.
write JSON string to out.
IOException |
---|
Encode a map into JSON text and write it to out. If this map is also a JSONAware or JSONStreamAware, JSONAware or JSONStreamAware specific behaviours will be ignored at this top level.
IOException |
---|