Class JSONArray

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

@Deprecated public class JSONArray extends ArrayList implements JSONAware, JSONStreamAware
Deprecated.
since 2.0.0, replaced by JsonArray
A JSON array. JSONObject supports java.util.List interface.
Author:
FangYidong<fangyidong@yahoo.com.cn>
See Also:
  • Constructor Details

    • JSONArray

      public JSONArray()
      Deprecated.
      Constructs an empty JSONArray.
    • JSONArray

      public JSONArray(Collection c)
      Deprecated.
      Constructs a JSONArray containing the elements of the specified collection, in the order they are returned by the collection's iterator.
      Parameters:
      c - the collection whose elements are to be placed into this JSONArray
  • Method Details

    • writeJSONString

      public static void writeJSONString(Collection collection, Writer out) throws IOException
      Deprecated.
      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:
      collection - 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(Collection collection)
      Deprecated.
      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:
      collection - description omitted.
      Returns:
      JSON text, or "null" if list is null.
      See Also:
    • writeJSONString

      public static void writeJSONString(byte[] array, Writer out) throws IOException
      Deprecated.
      description omitted.
      Parameters:
      array - description omitted.
      out - description omitted.
      Throws:
      IOException - description omitted.
    • toJSONString

      public static String toJSONString(byte[] array)
      Deprecated.
      description omitted.
      Parameters:
      array - description omitted.
      Returns:
      description omitted.
    • writeJSONString

      public static void writeJSONString(short[] array, Writer out) throws IOException
      Deprecated.
      description omitted.
      Parameters:
      array - description omitted.
      out - description omitted.
      Throws:
      IOException - description omitted.
    • toJSONString

      public static String toJSONString(short[] array)
      Deprecated.
      description omitted.
      Parameters:
      array - description omitted.
      Returns:
      description omitted.
    • writeJSONString

      public static void writeJSONString(int[] array, Writer out) throws IOException
      Deprecated.
      description omitted.
      Parameters:
      array - description omitted.
      out - description omitted.
      Throws:
      IOException - description omitted.
    • toJSONString

      public static String toJSONString(int[] array)
      Deprecated.
      description omitted.
      Parameters:
      array - description omitted.
      Returns:
      description omitted.
    • writeJSONString

      public static void writeJSONString(long[] array, Writer out) throws IOException
      Deprecated.
      description omitted.
      Parameters:
      array - description omitted.
      out - description omitted.
      Throws:
      IOException - description omitted.
    • toJSONString

      public static String toJSONString(long[] array)
      Deprecated.
      description omitted.
      Parameters:
      array - description omitted.
      Returns:
      description omitted.
    • writeJSONString

      public static void writeJSONString(float[] array, Writer out) throws IOException
      Deprecated.
      description omitted.
      Parameters:
      array - description omitted.
      out - description omitted.
      Throws:
      IOException - description omitted.
    • toJSONString

      public static String toJSONString(float[] array)
      Deprecated.
      description omitted.
      Parameters:
      array - description omitted.
      Returns:
      description omitted.
    • writeJSONString

      public static void writeJSONString(double[] array, Writer out) throws IOException
      Deprecated.
      description omitted.
      Parameters:
      array - description omitted.
      out - description omitted.
      Throws:
      IOException - description omitted.
    • toJSONString

      public static String toJSONString(double[] array)
      Deprecated.
      description omitted.
      Parameters:
      array - description omitted.
      Returns:
      description omitted.
    • writeJSONString

      public static void writeJSONString(boolean[] array, Writer out) throws IOException
      Deprecated.
      description omitted.
      Parameters:
      array - description omitted.
      out - description omitted.
      Throws:
      IOException - description omitted.
    • toJSONString

      public static String toJSONString(boolean[] array)
      Deprecated.
      description omitted.
      Parameters:
      array - description omitted.
      Returns:
      description omitted.
    • writeJSONString

      public static void writeJSONString(char[] array, Writer out) throws IOException
      Deprecated.
      description omitted.
      Parameters:
      array - description omitted.
      out - description omitted.
      Throws:
      IOException - description omitted.
    • toJSONString

      public static String toJSONString(char[] array)
      Deprecated.
      description omitted.
      Parameters:
      array - description omitted.
      Returns:
      description omitted.
    • writeJSONString

      public static void writeJSONString(Object[] array, Writer out) throws IOException
      Deprecated.
      description omitted.
      Parameters:
      array - description omitted.
      out - description omitted.
      Throws:
      IOException - description omitted.
    • toJSONString

      public static String toJSONString(Object[] array)
      Deprecated.
      description omitted.
      Parameters:
      array - description omitted.
      Returns:
      description omitted.
    • toJSONString

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

      public String toString()
      Deprecated.
      Returns a string representation of this array. This is equivalent to calling toJSONString().
      Overrides:
      toString in class AbstractCollection