| 612 | // FIXME: This method doesn't verify that the prior element was a property name. |
| 613 | // FIXME: This method doesn't enforce a depth limit when processing container types. |
| 614 | public void skipValue() { |
| 615 | switch (peek()) { |
| 616 | case BOOLEAN: |
| 617 | nextBoolean(); |
| 618 | break; |
| 619 | |
| 620 | case NAME: |
| 621 | nextName(); |
| 622 | break; |
| 623 | |
| 624 | case NULL: |
| 625 | nextNull(); |
| 626 | break; |
| 627 | |
| 628 | case NUMBER: |
| 629 | nextNumber(); |
| 630 | break; |
| 631 | |
| 632 | case START_COLLECTION: |
| 633 | beginArray(); |
| 634 | while (hasNext()) { |
| 635 | skipValue(); |
| 636 | } |
| 637 | endArray(); |
| 638 | break; |
| 639 | |
| 640 | case START_MAP: |
| 641 | beginObject(); |
| 642 | while (hasNext()) { |
| 643 | nextName(); |
| 644 | skipValue(); |
| 645 | } |
| 646 | endObject(); |
| 647 | break; |
| 648 | |
| 649 | case STRING: |
| 650 | nextString(); |
| 651 | break; |
| 652 | |
| 653 | default: |
| 654 | throw new JsonException("Cannot skip " + peek() + ". " + input); |
| 655 | } |
| 656 | } |
| 657 | |
| 658 | private void markReadPerformed() { |
| 659 | readPerformed = true; |