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.
()
| 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, |