Read an array of elements from the JSON input stream with elements as the specified type. @param type data type for deserialization (class or TypeToken) @return list of objects of the specified type deserialized from the JSON input stream NOTE : Returns null if the inp
(Type type)
| 541 | * @throws UncheckedIOException if an I/O exception is encountered |
| 542 | */ |
| 543 | public <T> List<T> readArray(Type type) { |
| 544 | List<T> toReturn = new ArrayList<>(); |
| 545 | |
| 546 | beginArray(); |
| 547 | while (hasNext()) { |
| 548 | toReturn.add(coercer.coerce(this, type, setter)); |
| 549 | } |
| 550 | endArray(); |
| 551 | |
| 552 | return toReturn; |
| 553 | } |
| 554 | |
| 555 | /** |
| 556 | * Determine if awaiting a JSON object property name. |