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 String
toJSONString
(List list) Convert a list to JSON text.toString()
void
writeJSONString
(Writer out) write JSON string to out.static void
writeJSONString
(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, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods 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:JSONStreamAware
write JSON string to out.- Specified by:
writeJSONString
in 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:
toJSONString
in interfaceJSONAware
- Returns:
- JSON text
-
toString
- Overrides:
toString
in classAbstractCollection
-