(Object obj, JsonReader reader)
| 470 | } |
| 471 | |
| 472 | private static void assertFullConsumption(Object obj, JsonReader reader) { |
| 473 | try { |
| 474 | if (obj != null && reader.peek() != JsonToken.END_DOCUMENT) { |
| 475 | throw new JsonIOException("JSON document was not fully consumed."); |
| 476 | } |
| 477 | } catch (MalformedJsonException e) { |
| 478 | throw new JsonSyntaxException(e); |
| 479 | } catch (IOException e) { |
| 480 | throw new JsonIOException(e); |
| 481 | } |
| 482 | } |
| 483 | |
| 484 | /** |
| 485 | * Reads the next JSON value from {@code reader} and convert it to an object |