Returns the next token, a JsonToken#NAME property name, and consumes it. @throws IOException if the next token in the stream is not a property name.
()
| 439 | * name. |
| 440 | */ |
| 441 | public String nextName() throws IOException { |
| 442 | quickPeek(); |
| 443 | if (token != JsonToken.NAME) { |
| 444 | throw new IllegalStateException("Expected a name but was " + peek()); |
| 445 | } |
| 446 | String result = name; |
| 447 | advance(); |
| 448 | return result; |
| 449 | } |
| 450 | |
| 451 | /** |
| 452 | * Returns the {@link JsonToken#STRING string} value of the next token, |