public class JsonObject
extends java.util.LinkedHashMap<java.lang.Object,java.lang.Object>
implements java.util.Map<java.lang.Object,java.lang.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.| Constructor and Description |
|---|
JsonObject() |
JsonObject(java.util.Map<?,?> map) |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
escape(java.lang.String s)
Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters
(U+0000 through U+001F).
|
java.lang.String |
toJSONString() |
static java.lang.String |
toJSONString(java.util.Map<?,?> map) |
java.lang.String |
toString() |
static java.lang.String |
toString(java.lang.String key,
java.lang.Object value) |
static void |
writeJSONString(java.util.Map<?,?> map,
java.io.Writer out) |
void |
writeJSONString(java.io.Writer out) |
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, valuespublic JsonObject()
public JsonObject(java.util.Map<?,?> map)
public static void writeJSONString(java.util.Map<?,?> map,
java.io.Writer out)
throws java.io.IOException
java.io.IOExceptionpublic void writeJSONString(java.io.Writer out)
throws java.io.IOException
writeJSONString in interface org.json.simple.JSONStreamAwarejava.io.IOExceptionpublic static java.lang.String toJSONString(java.util.Map<?,?> map)
public java.lang.String toJSONString()
toJSONString in interface org.json.simple.JSONAwarepublic java.lang.String toString()
toString in class java.util.AbstractMap<java.lang.Object,java.lang.Object>public static java.lang.String toString(java.lang.String key,
java.lang.Object value)
public static java.lang.String escape(java.lang.String s)
s - JSONValue.escape(String)Copyright © 2009-2018. All Rights Reserved.