|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<String,Object>
net.minidev.json.JSONObject
public class JSONObject
A JSON object. Key value pairs are unordered. JSONObject supports java.util.Map interface.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
Constructor Summary | |
---|---|
JSONObject()
|
|
JSONObject(Map<String,?> map)
Allows creation of a JSONObject from a Map. |
Method Summary | |
---|---|
static String |
escape(String s)
Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F). |
protected static JSONArray |
merge(JSONArray o1,
Object o2)
|
protected static JSONObject |
merge(JSONObject o1,
Object o2)
|
void |
merge(Object o2)
|
String |
toJSONString()
|
String |
toJSONString(JSONStyle compression)
|
static String |
toJSONString(Map<String,? extends Object> map)
|
static String |
toJSONString(Map<String,? extends Object> map,
JSONStyle compression)
Convert a map to JSON text. |
String |
toString()
|
String |
toString(JSONStyle compression)
|
static void |
writeJSON(Map<String,? extends Object> map,
Appendable out,
JSONStyle compression)
Encode a map into JSON text and write it to out. |
static void |
writeJSON(Map<String,Object> map,
Appendable out)
|
static void |
writeJSONKV(String key,
Object value,
Appendable out,
JSONStyle compression)
Write a Key : value entry to a stream |
void |
writeJSONString(Appendable out)
serialize Object as json to an stream |
void |
writeJSONString(Appendable out,
JSONStyle compression)
serialize Object as json to an stream |
Methods inherited from class java.util.HashMap |
---|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Constructor Detail |
---|
public JSONObject()
public JSONObject(Map<String,?> map)
Method Detail |
---|
public static String escape(String s)
JSONValue.escape(String)
public static String toJSONString(Map<String,? extends Object> map)
public static String toJSONString(Map<String,? extends Object> map, JSONStyle compression)
map
-
JSONValue.toJSONString(Object)
public static void writeJSONKV(String key, Object value, Appendable out, JSONStyle compression) throws IOException
IOException
public static void writeJSON(Map<String,Object> map, Appendable out) throws IOException
IOException
public static void writeJSON(Map<String,? extends Object> map, Appendable out, JSONStyle compression) throws IOException
IOException
JSONValue.writeJSONString(Object, Appendable)
public void writeJSONString(Appendable out) throws IOException
writeJSONString
in interface JSONStreamAware
IOException
public void writeJSONString(Appendable out, JSONStyle compression) throws IOException
writeJSONString
in interface JSONStreamAwareEx
IOException
public void merge(Object o2)
protected static JSONObject merge(JSONObject o1, Object o2)
protected static JSONArray merge(JSONArray o1, Object o2)
public String toJSONString()
toJSONString
in interface JSONAware
public String toJSONString(JSONStyle compression)
toJSONString
in interface JSONAwareEx
public String toString(JSONStyle compression)
public String toString()
toString
in class AbstractMap<String,Object>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |