JsonParser.getValue/getObject/getArray Exceptions #152 Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
diff --git a/api/src/main/java/jakarta/json/stream/JsonParser.java b/api/src/main/java/jakarta/json/stream/JsonParser.java index 43f46a2..0f71849 100644 --- a/api/src/main/java/jakarta/json/stream/JsonParser.java +++ b/api/src/main/java/jakarta/json/stream/JsonParser.java
@@ -360,9 +360,14 @@ * corresponding {@code END_OBJECT}. * * @return the {@code JsonObject} at the current parser position - * + * @throws jakarta.json.JsonException if an i/o error occurs (IOException + * would be cause of JsonException) * @throws IllegalStateException when the parser state is not * {@code START_OBJECT} + * @throws JsonParsingException if the parser encounters invalid JSON + * when advancing to next state. + * @throws java.util.NoSuchElementException if there are no more parsing + * states. * * @since 1.1 */ @@ -379,8 +384,14 @@ * read and returned. * * @return the {@code JsonValue} at the current parser position. + * @throws jakarta.json.JsonException if an i/o error occurs (IOException + * would be cause of JsonException) * @throws IllegalStateException when the parser state is * {@code END_OBJECT} or {@code END_ARRAY} + * @throws JsonParsingException if the parser encounters invalid JSON + * when advancing to next state. + * @throws java.util.NoSuchElementException if there are no more parsing + * states. * * @since 1.1 */ @@ -393,9 +404,14 @@ * the corresponding {@code END_ARRAY}. * * @return the {@code JsonArray} at the current parser position - * + * @throws jakarta.json.JsonException if an i/o error occurs (IOException + * would be cause of JsonException) * @throws IllegalStateException when the parser state is not * {@code START_ARRAY} + * @throws JsonParsingException if the parser encounters invalid JSON + * when advancing to next state. + * @throws java.util.NoSuchElementException if there are no more parsing + * states. * * @since 1.1 */