Public 成员函数 | |
| JsonStreamParser (String json) | |
| JsonStreamParser (Reader reader) | |
| JsonElement | next () throws JsonParseException |
| boolean | hasNext () |
| void | remove () |
Private 属性 | |
| final JsonReader | parser |
| final Object | lock |
A streaming parser that allows reading of multiple JsonElements from the specified reader asynchronously.
This class is conditionally thread-safe (see Item 70, Effective Java second edition). To properly use this class across multiple threads, you will need to add some external synchronization. For example:
JsonStreamParser parser = new JsonStreamParser("['first'] {'second':10} 'third'"); JsonElement element; synchronized (parser) { // synchronize on an object shared by threads if (parser.hasNext()) { element = parser.next(); } }
|
inline |
| json | The string containing JSON elements concatenated to each other. |
|
inline |
| reader | The data stream containing JSON elements concatenated to each other. |
|
inline |
Returns true if a JsonElement is available on the input for consumption
|
inline |
Returns the next available JsonElement on the reader. Null if none available.
| JsonParseException | if the incoming stream is malformed JSON. |
|
inline |
This optional Iterator method is not relevant for stream parsing and hence is not implemented.
|
private |
|
private |
1.8.8