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

Method nextString

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

Returns the JsonToken#STRING string value of the next token, consuming it. If the next token is a number, this method will return its string form. @throws IllegalStateException if the next token is not a string or if this reader is closed.

()

Source from the content-addressed store, hash-verified

457 * this reader is closed.
458 */
459 public String nextString() throws IOException {
460 peek();
461 if (value == null || (token != JsonToken.STRING && token != JsonToken.NUMBER)) {
462 throw new IllegalStateException("Expected a string but was " + peek());
463 }
464
465 String result = value;
466 advance();
467 return result;
468 }
469
470 /**
471 * Returns the {@link JsonToken#BOOLEAN boolean} value of the next token,

Calls 7

peekMethod · 0.95
advanceMethod · 0.95
readEscapeCharacterMethod · 0.95
fillBufferMethod · 0.95
syntaxErrorMethod · 0.95
appendMethod · 0.80
toStringMethod · 0.45