Skip to content

Commit b1edb70

Browse files
committed
Improve incorrect JsonStreamParser doc
1 parent ceae88b commit b1edb70

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

gson/src/main/java/com/google/gson/JsonStreamParser.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@
2929

3030
/**
3131
* A streaming parser that allows reading of multiple {@link JsonElement}s from the specified reader
32-
* asynchronously.
33-
*
32+
* asynchronously. The JSON data is parsed in lenient mode, see also
33+
* {@link JsonReader#setLenient(boolean)}.
34+
*
3435
* <p>This class is conditionally thread-safe (see Item 70, Effective Java second edition). To
3536
* properly use this class across multiple threads, you will need to add some external
3637
* synchronization. For example:
@@ -72,10 +73,12 @@ public JsonStreamParser(Reader reader) {
7273
}
7374

7475
/**
75-
* Returns the next available {@link JsonElement} on the reader. Null if none available.
76-
*
77-
* @return the next available {@link JsonElement} on the reader. Null if none available.
78-
* @throws JsonParseException if the incoming stream is malformed JSON.
76+
* Returns the next available {@link JsonElement} on the reader. Throws a
77+
* {@link NoSuchElementException} if no element is available.
78+
*
79+
* @return the next available {@code JsonElement} on the reader.
80+
* @throws JsonSyntaxException if the incoming stream is malformed JSON.
81+
* @throws NoSuchElementException if no {@code JsonElement} is available.
7982
* @since 1.4
8083
*/
8184
public JsonElement next() throws JsonParseException {
@@ -97,6 +100,7 @@ public JsonElement next() throws JsonParseException {
97100
/**
98101
* Returns true if a {@link JsonElement} is available on the input for consumption
99102
* @return true if a {@link JsonElement} is available on the input, false otherwise
103+
* @throws JsonSyntaxException if the incoming stream is malformed JSON.
100104
* @since 1.4
101105
*/
102106
public boolean hasNext() {

0 commit comments

Comments
 (0)