Skip to content

Commit

Permalink
JsonParser.getValue/getObject/getArray Exceptions #152
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
  • Loading branch information
jbescos authored and lukasj committed Oct 29, 2021
1 parent 194d561 commit e621909
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions api/src/main/java/jakarta/json/stream/JsonParser.java
Expand Up @@ -360,9 +360,14 @@ default public Event currentEvent() {
* 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
*/
Expand All @@ -379,8 +384,14 @@ default public JsonObject getObject() {
* 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
*/
Expand All @@ -393,9 +404,14 @@ default public JsonValue getValue() {
* 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
*/
Expand Down

0 comments on commit e621909

Please sign in to comment.