public class JSONObject extends HashMap implements Map, JSONAware, JSONStreamAware
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
JSONObject() |
Modifier and Type | Method and Description |
---|---|
String |
toJSONString()
Returns a JSON string representing this object.
|
static String |
toJSONString(Map map)
Convert a map to JSON text.
|
String |
toString()
Returns a string representation of this object.
|
static String |
toString(String key,
Object value)
Returns a JSON string fragment containing the key and value.
|
static void |
writeJSONString(Map map,
Writer out)
Encode a map into JSON text and write it to out.
|
void |
writeJSONString(Writer out)
Writes a JSON string representing this object instance to the specified
output writer.
|
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
equals, hashCode
finalize, getClass, notify, notifyAll, wait, wait, wait
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
public static void writeJSONString(Map map, Writer out) throws IOException
JSONAware
or JSONStreamAware
,
JSONAware
or JSONStreamAware
specific
behaviours will be ignored at this top level.map
- the map to write (null
permitted).out
- the output writer (null
not permitted).IOException
- if there is an I/O problem.JSONValue.writeJSONString(Object, Writer)
public void writeJSONString(Writer out) throws IOException
writeJSONString
in interface JSONStreamAware
out
- the output writer (null
not permitted).IOException
- if there is an I/O problem.public static String toJSONString(Map map)
JSONAware
, JSONAware
specific
behaviours will be omitted at this top level.map
- the map (null
permitted).JSONValue.toJSONString(Object)
public String toJSONString()
toJSONString
in interface JSONAware
public String toString()
toString
in class AbstractMap
Copyright © 2001–2017 JFree.org. All rights reserved.