java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
java.util.ArrayList
org.jooq.tools.json.JSONArray
- All Implemented Interfaces:
- Serializable,- Cloneable,- Iterable,- Collection,- List,- RandomAccess,- SequencedCollection
A JSON array. JSONObject supports java.util.List interface.
- Author:
- FangYidong<fangyidong@yahoo.com.cn>
- See Also:
- 
Field SummaryFields inherited from class java.util.AbstractListmodCount
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs an empty JSONArray.Constructs a JSONArray containing the elements of the specified collection, in the order they are returned by the collection's iterator.
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringtoJSONString(List<?> list) Convert a list to JSON text.toString()static voidwriteJSONString(List<?> list, Writer out) Encode a list into JSON text and write it to out.Methods inherited from class java.util.ArrayListadd, 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.AbstractCollectioncontainsAllMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.CollectionparallelStream, stream, toArrayMethods inherited from interface java.util.ListcontainsAll, reversed
- 
Constructor Details- 
JSONArraypublic JSONArray()Constructs an empty JSONArray.
- 
JSONArrayConstructs 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- 
writeJSONStringEncode a list into JSON text and write it to out.- Throws:
- IOException
- See Also:
 
- 
toJSONStringConvert a list to JSON text. The result is a JSON array.- Returns:
- JSON text, or "null" if list is null.
- See Also:
 
- 
toString- Overrides:
- toStringin class- AbstractCollection
 
 
-