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
()
| 229 | * @throws UncheckedIOException if an I/O exception is encountered |
| 230 | */ |
| 231 | public String nextName() { |
| 232 | expect(JsonType.NAME); |
| 233 | |
| 234 | String name = readString(); |
| 235 | skipWhitespace(input); |
| 236 | int read = input.read(); |
| 237 | if (read != ':') { |
| 238 | throw new JsonException( |
| 239 | "Unable to read name. Expected colon separator, but saw '" + (char) read + "'"); |
| 240 | } |
| 241 | return name; |
| 242 | } |
| 243 | |
| 244 | /** |
| 245 | * Read the next element of the JSON input stream as a {@code null} object. |