Home | History | Annotate | Download | only in json

Lines Matching full:jsonarray

36  * A JSONArray is an ordered sequence of values. Its external text form is a
41 * <code>Boolean</code>, <code>JSONArray</code>, <code>JSONObject</code>,
83 public class JSONArray {
87 * The arrayList where the JSONArray's properties are kept.
93 * Construct an empty JSONArray.
95 public JSONArray() {
100 * Construct a JSONArray from a JSONTokener.
104 public JSONArray(JSONTokener x) throws JSONException {
113 throw x.syntaxError("A JSONArray text must start with '['");
150 * Construct a JSONArray from a source JSON text.
156 public JSONArray(String source) throws JSONException {
162 * Construct a JSONArray from a Collection.
165 public JSONArray(Collection collection) {
172 * Construct a JSONArray from a collection of beans.
178 public JSONArray(Collection collection, boolean includeSuperClass) {
197 * Construct a JSONArray from an array
200 public JSONArray(Object array) throws JSONException {
208 throw new JSONException("JSONArray initial value should be a string or collection or array.");
213 * Construct a JSONArray from an array with a bean.
218 public JSONArray(Object array,boolean includeSuperClass) throws JSONException {
231 throw new JSONException("JSONArray initial value should be a string or collection or array.");
247 throw new JSONException("JSONArray[" + index + "] not found.");
273 throw new JSONException("JSONArray[" + index + "] is not a Boolean.");
292 throw new JSONException("JSONArray[" + index +
315 * Get the JSONArray associated with an index.
317 * @return A JSONArray value.
319 * value is not a JSONArray
321 public JSONArray getJSONArray(int index) throws JSONException {
323 if (o instanceof JSONArray) {
324 return (JSONArray)o;
326 throw new JSONException("JSONArray[" + index +
327 "] is not a JSONArray.");
343 throw new JSONException("JSONArray[" + index +
385 * Make a string from the contents of this JSONArray. The
407 * Get the number of elements in the JSONArray, included nulls.
521 * Get the optional JSONArray associated with an index.
523 * @return A JSONArray value, or null if the index has no value,
524 * or if the value is not a JSONArray.
526 public JSONArray optJSONArray(int index) {
528 return o instanceof JSONArray ? (JSONArray)o : null;
609 public JSONArray put(boolean value) {
616 * Put a value in the JSONArray, where the value will be a
617 * JSONArray which is produced from a Collection.
621 public JSONArray put(Collection value) {
622 put(new JSONArray(value));
634 public JSONArray put(double value) throws JSONException {
648 public JSONArray put(int value) {
660 public JSONArray put(long value) {
667 * Put a value in the JSONArray, where the value will be a
672 public JSONArray put(Map value) {
681 * Boolean, Double, Integer, JSONArray, JSONObject, Long, or String, or the
685 public JSONArray put(Object value) {
692 * Put or replace a boolean value in the JSONArray. If the index is greater
693 * than the length of the JSONArray, then null elements will be added as
700 public JSONArray put(int index, boolean value) throws JSONException {
707 * Put a value in the JSONArray, where the value will be a
708 * JSONArray which is produced from a Collection.
715 public JSONArray put(int index, Collection value) throws JSONException {
716 put(index, new JSONArray(value));
723 * the JSONArray, then null elements will be added as necessary to pad
731 public JSONArray put(int index, double value) throws JSONException {
739 * the JSONArray, then null elements will be added as necessary to pad
746 public JSONArray put(int index, int value) throws JSONException {
754 * the JSONArray, then null elements will be added as necessary to pad
761 public JSONArray put(int index, long value) throws JSONException {
768 * Put a value in the JSONArray, where the value will be a
776 public JSONArray put(int index, Map value) throws JSONException {
783 * Put or replace an object value in the JSONArray. If the index is greater
784 * than the length of the JSONArray, then null elements will be added as
788 * Boolean, Double, Integer, JSONArray, JSONObject, Long, or String, or the
794 public JSONArray put(int index, Object value) throws JSONException {
797 throw new JSONException("JSONArray[" + index + "] not found.");
825 * Produce a JSONObject by combining a JSONArray of names with the values
826 * of this JSONArray.
827 * @param names A JSONArray containing a list of key strings. These will be
829 * @return A JSONObject, or null if there are no names or if this JSONArray
833 public JSONObject toJSONObject(JSONArray names) throws JSONException {
846 * Make a JSON text of this JSONArray. For compactness, no
866 * Make a prettyprinted JSON text of this JSONArray.
882 * Make a prettyprinted JSON text of this JSONArray.
925 * Write the contents of the JSONArray as JSON text to a writer.
947 } else if (v instanceof JSONArray) {
948 ((JSONArray)v).write(writer);