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)
| 482 | * @throws UncheckedIOException if an I/O exception is encountered |
| 483 | */ |
| 484 | public <T> List<T> readArray(Type type) { |
| 485 | List<T> toReturn = new ArrayList<>(); |
| 486 | |
| 487 | beginArray(); |
| 488 | while (hasNext()) { |
| 489 | toReturn.add(coercer.coerce(this, type, setter)); |
| 490 | } |
| 491 | endArray(); |
| 492 | |
| 493 | return toReturn; |
| 494 | } |
| 495 | |
| 496 | /** |
| 497 | * Determine if awaiting a JSON object property name. |