MCPcopy
hub / github.com/google/gson / endObject

Method endObject

gson/src/main/java/com/google/gson/stream/JsonReader.java:517–530  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

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 {

Callers 15

pathMethod · 0.95
objectPathMethod · 0.95
arrayOfObjectsMethod · 0.95
objectOfObjectsMethod · 0.95
testReadObjectMethod · 0.95
testReadEmptyObjectMethod · 0.95
testSkipArrayMethod · 0.95

Calls 2

doPeekMethod · 0.95
unexpectedTokenErrorMethod · 0.95

Tested by 15

pathMethod · 0.76
objectPathMethod · 0.76
arrayOfObjectsMethod · 0.76
objectOfObjectsMethod · 0.76
testReadObjectMethod · 0.76
testReadEmptyObjectMethod · 0.76
testSkipArrayMethod · 0.76
testSkipObjectMethod · 0.76
testSkipIntegerMethod · 0.76