Package org.json.simple
Class JSONArray
java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
java.util.ArrayList
org.json.simple.JSONArray
- All Implemented Interfaces:
Serializable,Cloneable,Iterable,Collection,List,RandomAccess,SequencedCollection,JSONAware,JSONStreamAware
A JSON array. JSONObject supports java.util.List interface.
- See Also:
-
Field Summary
FieldsFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringtoJSONString(List list) Convert a list to JSON text.toString()voidwriteJSONString(Writer out) write JSON string to out.static voidwriteJSONString(List list, Writer out) Encode a list into JSON text and write it to out.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAllMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
add, add, addAll, addAll, addFirst, addLast, clear, contains, containsAll, equals, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, set, size, sort, spliterator, subList, toArray, toArray
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
JSONArray
public JSONArray()
-
-
Method Details
-
writeJSONString
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-out-- Throws:
IOException- See Also:
-
writeJSONString
Description copied from interface:JSONStreamAwarewrite JSON string to out.- Specified by:
writeJSONStringin interfaceJSONStreamAware- Throws:
IOException
-
toJSONString
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-- Returns:
- JSON text, or "null" if list is null.
- See Also:
-
toJSONString
- Specified by:
toJSONStringin interfaceJSONAware- Returns:
- JSON text
-
toString
- Overrides:
toStringin classAbstractCollection
-