public class JSONObject extends HashMap implements Map, JSONAware, JSONStreamAware
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
JSONObject() |
JSONObject(Map map)
Allows creation of a JSONObject from a Map.
|
Modifier and Type | Method and Description |
---|---|
static String |
escape(String s)
Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F).
|
String |
toJSONString() |
static String |
toJSONString(Map map)
Convert a map to JSON text.
|
String |
toString() |
static String |
toString(String key,
Object value) |
static void |
writeJSONString(Map map,
Writer out)
Encode a map into JSON text and write it to out.
|
void |
writeJSONString(Writer out)
write JSON string to out.
|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
equals, hashCode
public JSONObject()
public JSONObject(Map map)
map
- public static void writeJSONString(Map map, Writer out) throws IOException
map
- out
- IOException
JSONValue.writeJSONString(Object, Writer)
public void writeJSONString(Writer out) throws IOException
JSONStreamAware
writeJSONString
in interface JSONStreamAware
IOException
public static String toJSONString(Map map)
map
- JSONValue.toJSONString(Object)
public String toJSONString()
toJSONString
in interface JSONAware
public String toString()
toString
in class AbstractMap
public static String escape(String s)
s
- JSONValue.escape(String)
Copyright © 2016. All Rights Reserved.