| 389 | // FIXME: This method doesn't verify that the prior element was a property name. |
| 390 | // FIXME: This method doesn't enforce a depth limit when processing container types. |
| 391 | public void skipValue() { |
| 392 | switch (peek()) { |
| 393 | case BOOLEAN: |
| 394 | nextBoolean(); |
| 395 | break; |
| 396 | |
| 397 | case NAME: |
| 398 | nextName(); |
| 399 | break; |
| 400 | |
| 401 | case NULL: |
| 402 | nextNull(); |
| 403 | break; |
| 404 | |
| 405 | case NUMBER: |
| 406 | nextNumber(); |
| 407 | break; |
| 408 | |
| 409 | case START_COLLECTION: |
| 410 | beginArray(); |
| 411 | while (hasNext()) { |
| 412 | skipValue(); |
| 413 | } |
| 414 | endArray(); |
| 415 | break; |
| 416 | |
| 417 | case START_MAP: |
| 418 | beginObject(); |
| 419 | while (hasNext()) { |
| 420 | nextName(); |
| 421 | skipValue(); |
| 422 | } |
| 423 | endObject(); |
| 424 | break; |
| 425 | |
| 426 | case STRING: |
| 427 | nextString(); |
| 428 | break; |
| 429 | |
| 430 | default: |
| 431 | throw new JsonException("Cannot skip " + peek() + ". " + input); |
| 432 | } |
| 433 | } |
| 434 | |
| 435 | private void markReadPerformed() { |
| 436 | readPerformed = true; |