Module platform

Class JSONArray

All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List, RandomAccess, JSONAware, JSONStreamAware

public class JSONArray extends ArrayList implements List, JSONAware, JSONStreamAware
A JSON array.

This class is for internal use by JFreeChart, it is not part of the supported API and you should not call it directly. If you need JSON support in your project you should include JSON.simple (https://code.google.com/p/json-simple/) or some other JSON library directly in your project.
See Also:
  • Constructor Details

    • JSONArray

      public JSONArray()
  • Method Details

    • writeJSONString

      public static void writeJSONString(List list, Writer out) throws IOException
      Encode a list into JSON text and write it to out. If this list is also a JSONStreamAware or a JSONAware, JSONStreamAware and JSONAware specific behaviours will be ignored at this top level.
      Parameters:
      list - the list (null permitted).
      out - the output writer (null not permitted).
      Throws:
      IOException - if there is an I/O problem.
      See Also:
    • writeJSONString

      public void writeJSONString(Writer out) throws IOException
      Writes this array to the specified output writer.
      Specified by:
      writeJSONString in interface JSONStreamAware
      Parameters:
      out - the output writer (null not permitted).
      Throws:
      IOException - if there is an I/O problem.
    • toJSONString

      public static String toJSONString(List list)
      Convert a list to JSON text. The result is a JSON array. If this list is also a JSONAware, JSONAware specific behaviours will be omitted at this top level.
      Parameters:
      list - the list (null permitted).
      Returns:
      JSON text, or "null" if list is null.
      See Also:
    • toJSONString

      public String toJSONString()
      Returns a JSON string representation of this list.
      Specified by:
      toJSONString in interface JSONAware
      Returns:
      A string.
    • toString

      public String toString()
      Returns a string representation of this list.
      Overrides:
      toString in class AbstractCollection
      Returns:
      A string.