Determine whether an element is pending for the current container from the JSON input stream. @return true if an element is pending; otherwise false @throws JsonException if no container is open @throws UncheckedIOException if an I/O exception is encountered
()
| 312 | * @throws UncheckedIOException if an I/O exception is encountered |
| 313 | */ |
| 314 | public boolean hasNext() { |
| 315 | if (stack.isEmpty()) { |
| 316 | throw new JsonException( |
| 317 | "Unable to determine if an item has next when not in a container type. " + input); |
| 318 | } |
| 319 | |
| 320 | skipWhitespace(input); |
| 321 | if (input.peek() == ',') { |
| 322 | input.read(); |
| 323 | return true; |
| 324 | } |
| 325 | |
| 326 | JsonType type = peek(); |
| 327 | return type != JsonType.END_COLLECTION && type != JsonType.END_MAP; |
| 328 | } |
| 329 | |
| 330 | /** |
| 331 | * Process the opening square bracket of a JSON array. |