org.jooq.tools.json
Class JSONObject

java.lang.Object
  extended by org.jooq.tools.json.JSONObject

public class JSONObject
extends Object

A JSON object. Key value pairs are unordered. JSONObject supports java.util.Map interface.

Author:
FangYidong

Constructor Summary
JSONObject()
           
 
Method Summary
static String escape(String s)
          Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F).
static String toJSONString(Map<?,?> map)
          Convert a map to JSON text.
static String toString(String key, Object value)
           
static void writeJSONString(Map<?,?> map, Writer out)
          Encode a map into JSON text and write it to out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSONObject

public JSONObject()
Method Detail

writeJSONString

public static void writeJSONString(Map<?,?> map,
                                   Writer out)
                            throws IOException
Encode a map into JSON text and write it to out. If this map is also a JSONAware or JSONStreamAware, JSONAware or JSONStreamAware specific behaviours will be ignored at this top level.

Throws:
IOException
See Also:
JSONValue.writeJSONString(Object, Writer)

toJSONString

public static String toJSONString(Map<?,?> map)
Convert a map to JSON text. The result is a JSON object. If this map is also a JSONAware, JSONAware specific behaviours will be omitted at this top level.

Returns:
JSON text, or "null" if map is null.
See Also:
JSONValue.toJSONString(Object)

toString

public static String toString(String key,
                              Object value)

escape

public static String escape(String s)
Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F). It's the same as JSONValue.escape() only for compatibility here.

See Also:
JSONValue.escape(String)


Copyright © 2012. All Rights Reserved.