| 448 | // FIXME: This method doesn't verify that the prior element was a property name. |
| 449 | // FIXME: This method doesn't enforce a depth limit when processing container types. |
| 450 | public void skipValue() { |
| 451 | switch (peek()) { |
| 452 | case BOOLEAN: |
| 453 | nextBoolean(); |
| 454 | break; |
| 455 | |
| 456 | case NAME: |
| 457 | nextName(); |
| 458 | break; |
| 459 | |
| 460 | case NULL: |
| 461 | nextNull(); |
| 462 | break; |
| 463 | |
| 464 | case NUMBER: |
| 465 | nextNumber(); |
| 466 | break; |
| 467 | |
| 468 | case START_COLLECTION: |
| 469 | beginArray(); |
| 470 | while (hasNext()) { |
| 471 | skipValue(); |
| 472 | } |
| 473 | endArray(); |
| 474 | break; |
| 475 | |
| 476 | case START_MAP: |
| 477 | beginObject(); |
| 478 | while (hasNext()) { |
| 479 | nextName(); |
| 480 | skipValue(); |
| 481 | } |
| 482 | endObject(); |
| 483 | break; |
| 484 | |
| 485 | case STRING: |
| 486 | nextString(); |
| 487 | break; |
| 488 | |
| 489 | default: |
| 490 | throw new JsonException("Cannot skip " + peek() + ". " + input); |
| 491 | } |
| 492 | } |
| 493 | |
| 494 | private void markReadPerformed() { |
| 495 | readPerformed = true; |