Consumes the next token from the JSON stream and asserts that it is the end of the current object. @throws IllegalStateException if the next token is not the end of an object.
()
| 515 | * @throws IllegalStateException if the next token is not the end of an object. |
| 516 | */ |
| 517 | public void endObject() throws IOException { |
| 518 | int p = peeked; |
| 519 | if (p == PEEKED_NONE) { |
| 520 | p = doPeek(); |
| 521 | } |
| 522 | if (p == PEEKED_END_OBJECT) { |
| 523 | stackSize--; |
| 524 | pathNames[stackSize] = null; // Free the last path name so that it can be garbage collected! |
| 525 | pathIndices[stackSize - 1]++; |
| 526 | peeked = PEEKED_NONE; |
| 527 | } else { |
| 528 | throw unexpectedTokenError("END_OBJECT"); |
| 529 | } |
| 530 | } |
| 531 | |
| 532 | /** Returns true if the current array or object has another element. */ |
| 533 | public boolean hasNext() throws IOException { |