public class

JSONArray

extends ArrayList<E>
implements JSONAware JSONStreamAware
java.lang.Object
   ↳ java.util.AbstractCollection<E>
     ↳ java.util.AbstractList<E>
       ↳ java.util.ArrayList<E>
         ↳ com.pnfsoftware.jeb.util.encoding.json.JSONArray

Class Overview

A JSON array. JSONObject supports java.util.List interface.

Summary

[Expand]
Inherited Fields
From class java.util.AbstractList
Public Constructors
JSONArray()
Constructs an empty JSONArray.
JSONArray(Collection c)
Constructs a JSONArray containing the elements of the specified collection, in the order they are returned by the collection's iterator.
Public Methods
static String toJSONString(boolean[] array)
static String toJSONString(long[] array)
static String toJSONString(char[] array)
static String toJSONString(short[] array)
static String toJSONString(float[] array)
static String toJSONString(int[] array)
static String toJSONString(Collection collection)
Convert a list to JSON text.
static String toJSONString(double[] array)
static String toJSONString(Object[] array)
static String toJSONString(byte[] array)
String toJSONString()
String toString()
Returns a string representation of this array.
void writeJSONString(Writer out)
write JSON string to out.
static void writeJSONString(char[] array, Writer out)
static void writeJSONString(byte[] array, Writer out)
static void writeJSONString(float[] array, Writer out)
static void writeJSONString(long[] array, Writer out)
static void writeJSONString(Object[] array, Writer out)
static void writeJSONString(Collection collection, Writer out)
Encode a list into JSON text and write it to out.
static void writeJSONString(double[] array, Writer out)
static void writeJSONString(int[] array, Writer out)
static void writeJSONString(boolean[] array, Writer out)
static void writeJSONString(short[] array, Writer out)
[Expand]
Inherited Methods
From class java.util.ArrayList
From class java.util.AbstractList
From class java.util.AbstractCollection
From class java.lang.Object
From interface com.pnfsoftware.jeb.util.encoding.json.JSONAware
From interface com.pnfsoftware.jeb.util.encoding.json.JSONStreamAware
From interface java.lang.Iterable
From interface java.util.Collection
From interface java.util.List

Public Constructors

public JSONArray ()

Constructs an empty JSONArray.

public JSONArray (Collection c)

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

Public Methods

public static String toJSONString (boolean[] array)

public static String toJSONString (long[] array)

public static String toJSONString (char[] array)

public static String toJSONString (short[] array)

public static String toJSONString (float[] array)

public static String toJSONString (int[] array)

public static String toJSONString (Collection collection)

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.

Returns
  • JSON text, or "null" if list is null.

public static String toJSONString (double[] array)

public static String toJSONString (Object[] array)

public static String toJSONString (byte[] array)

public String toJSONString ()

public String toString ()

Returns a string representation of this array. This is equivalent to calling toJSONString().

public void writeJSONString (Writer out)

write JSON string to out.

Throws
IOException

public static void writeJSONString (char[] array, Writer out)

Throws
IOException

public static void writeJSONString (byte[] array, Writer out)

Throws
IOException

public static void writeJSONString (float[] array, Writer out)

Throws
IOException

public static void writeJSONString (long[] array, Writer out)

Throws
IOException

public static void writeJSONString (Object[] array, Writer out)

Throws
IOException

public static void writeJSONString (Collection collection, Writer out)

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.

Throws
IOException

public static void writeJSONString (double[] array, Writer out)

Throws
IOException

public static void writeJSONString (int[] array, Writer out)

Throws
IOException

public static void writeJSONString (boolean[] array, Writer out)

Throws
IOException

public static void writeJSONString (short[] array, Writer out)

Throws
IOException