public class JsonObject extends LinkedHashMap<Object,Object> implements Map<Object,Object>, org.json.simple.JSONAware, org.json.simple.JSONStreamAware
This class is and all code is a direct copy of the org.json.simple.JSONObject implementation found here: http://json-simple.googlecode.com/svn/trunk/src/org /json/simple/JSONObject.java
It has been duplicated for the sole purpose of moving to a LinkedHashMap to preserve order. All credit must go to the original authors.
Because JSONValue.escape() is inaccessible from outside the original package it needed to be added to the end of the class as well.
A JSON object. Key value pairs are unordered. JSONObject supports java.util.Map interface.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
JsonObject() |
JsonObject(Map<?,?> 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) |
String |
toString() |
static String |
toString(String key,
Object value) |
static void |
writeJSONString(Map<?,?> map,
Writer out) |
void |
writeJSONString(Writer out) |
clear, containsValue, get, removeEldestEntryclone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, valuesequals, hashCodepublic JsonObject()
public JsonObject(Map<?,?> map)
public static void writeJSONString(Map<?,?> map, Writer out) throws IOException
IOExceptionpublic void writeJSONString(Writer out) throws IOException
writeJSONString in interface org.json.simple.JSONStreamAwareIOExceptionpublic String toJSONString()
toJSONString in interface org.json.simple.JSONAwarepublic String toString()
toString in class AbstractMap<Object,Object>Copyright © 2009-2013. All Rights Reserved.