Consumes the next token from the JSON stream and asserts that it is a literal null. @throws IllegalStateException if the next token is not null or if this reader is closed.
()
| 501 | * reader is closed. |
| 502 | */ |
| 503 | public void nextNull() throws IOException { |
| 504 | quickPeek(); |
| 505 | if (value == null || token == JsonToken.STRING) { |
| 506 | throw new IllegalStateException("Expected null but was " + peek()); |
| 507 | } |
| 508 | |
| 509 | if (!value.equalsIgnoreCase("null")) { |
| 510 | throw new IllegalStateException("Not a null: " + value); |
| 511 | } |
| 512 | |
| 513 | advance(); |
| 514 | } |
| 515 | |
| 516 | /** |
| 517 | * Returns the {@link JsonToken#NUMBER double} value of the next token, |