java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap
org.jooq.tools.json.JSONObject
- All Implemented Interfaces:
Serializable
,Cloneable
,Map
A JSON object. Key value pairs are unordered. JSONObject supports
java.util.Map interface.
- Author:
- FangYidong<fangyidong@yahoo.com.cn>
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
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.toString()
static String
static void
writeJSONString
(Map<?, ?> map, Writer out) Encode a map into JSON text and write it to out.Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode
-
Constructor Details
-
JSONObject
public JSONObject() -
JSONObject
-
-
Method Details
-
writeJSONString
Encode a map into JSON text and write it to out.- Throws:
IOException
- See Also:
-
toJSONString
Convert a map to JSON text. The result is a JSON object.- Returns:
- JSON text, or "null" if map is null.
- See Also:
-
toString
-
toString
- Overrides:
toString
in classAbstractMap
-
escape
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.- See Also:
-