public class JSONObject extends LinkedHashMap<String,Object> implements Map<String,Object>, JSONAware, JSONStreamAware
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
JSONObject() |
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).
|
Object |
put(String key,
Object value) |
String |
toJSONString() |
static String |
toJSONString(Map<String,Object> map)
Convert a map to JSON text.
|
String |
toString() |
static String |
toString(String key,
Object value) |
static void |
writeJSONString(Map<String,Object> map,
Writer out)
Encode a map into JSON text and write it to out.
|
void |
writeJSONString(Writer out)
write JSON string to out.
|
clear, containsValue, get, removeEldestEntry
clone, containsKey, entrySet, isEmpty, keySet, putAll, remove, size, values
equals, hashCode
public static void writeJSONString(Map<String,Object> map, Writer out) throws IOException
map
- out
- IOException
org.json.simple.JSONValue#writeJSONString(Object, Writer)
public void writeJSONString(Writer out) throws IOException
JSONStreamAware
writeJSONString
in interface JSONStreamAware
IOException
public static String toJSONString(Map<String,Object> map)
map
- org.json.simple.JSONValue#toJSONString(Object)
public String toJSONString()
toJSONString
in interface JSONAware
public String toString()
toString
in class AbstractMap<String,Object>
public static String escape(String s)
s
- JSONValue.escape(String)
Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.