Class JSONObject

All Implemented Interfaces:
Serializable, Cloneable, Map, JSONAware, JSONStreamAware

@Deprecated public class JSONObject extends HashMap implements Map, JSONAware, JSONStreamAware
Deprecated.
since 2.0.0, replaced by JsonObject
A JSON object. Key value pairs are unordered. JSONObject supports java.util.Map interface.
Author:
FangYidong<fangyidong@yahoo.com.cn>
See Also:
  • Constructor Details

    • JSONObject

      public JSONObject()
      Deprecated.
    • JSONObject

      public JSONObject(Map map)
      Deprecated.
      Allows creation of a JSONObject from a Map. After that, both the generated JSONObject and the Map can be modified independently.
      Parameters:
      map - description omitted.
  • Method Details

    • writeJSONString

      public static void writeJSONString(Map map, Writer out) throws IOException
      Deprecated.
      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.
      Parameters:
      map - description omitted.
      out - description omitted.
      Throws:
      IOException - description omitted.
      See Also:
    • writeJSONString

      public void writeJSONString(Writer out) throws IOException
      Deprecated.
      Description copied from interface: JSONStreamAware
      write JSON string to out.
      Specified by:
      writeJSONString in interface JSONStreamAware
      Parameters:
      out - description omitted.
      Throws:
      IOException - description omitted.
    • toJSONString

      public static String toJSONString(Map map)
      Deprecated.
      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.
      Parameters:
      map - description omitted.
      Returns:
      JSON text, or "null" if map is null.
      See Also:
    • toJSONString

      public String toJSONString()
      Deprecated.
      Specified by:
      toJSONString in interface JSONAware
      Returns:
      JSON text
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class AbstractMap
    • toString

      public static String toString(String key, Object value)
      Deprecated.
      description omitted.
      Parameters:
      key - description omitted.
      value - description omitted.
      Returns:
      description omitted.
    • escape

      public static String escape(String s)
      Deprecated.
      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.
      Parameters:
      s - description omitted.
      Returns:
      description omitted.
      See Also: