Read the next element of the JSON input stream as an object property name. @return JSON object property name @throws JsonException if the next element isn't a string followed by a colon @throws UncheckedIOException if an I/O exception is encountered
()
| 190 | * @throws UncheckedIOException if an I/O exception is encountered |
| 191 | */ |
| 192 | public String nextName() { |
| 193 | expect(JsonType.NAME); |
| 194 | |
| 195 | String name = readString(); |
| 196 | skipWhitespace(input); |
| 197 | char read = input.read(); |
| 198 | if (read != ':') { |
| 199 | throw new JsonException( |
| 200 | "Unable to read name. Expected colon separator, but saw '" + read + "'"); |
| 201 | } |
| 202 | return name; |
| 203 | } |
| 204 | |
| 205 | /** |
| 206 | * Read the next element of the JSON input stream as a {@code null} object. |