public class JsonParserImpl extends Object implements JsonParser
| Constructor and Description |
|---|
JsonParserImpl(ReadStream<Buffer> stream) |
| Modifier and Type | Method and Description |
|---|---|
JsonParser |
arrayEventMode()
Flip the parser to emit a stream of events for each new json array.
|
JsonParser |
arrayValueMode()
Flip the parser to emit a single value event for each new json array.
|
void |
end()
End the stream, this must be called after all the json stream has been processed.
|
JsonParser |
endHandler(Handler<Void> handler)
Set an end handler.
|
JsonParser |
exceptionHandler(Handler<Throwable> handler)
Set an exception handler on the read stream.
|
JsonParser |
fetch(long amount)
Fetch the specified
amount of elements. |
void |
handle(Buffer event)
Something has happened, so handle it.
|
JsonParser |
handler(Handler<JsonEvent> handler)
Set a data handler.
|
JsonParser |
objectEventMode()
Flip the parser to emit a stream of events for each new json object.
|
JsonParser |
objectValueMode()
Flip the parser to emit a single value event for each new json object.
|
JsonParser |
pause()
Pause the
ReadStream, it sets the buffer in fetch mode and clears the actual demand. |
JsonParser |
resume()
Resume reading, and sets the buffer in
flowing mode. |
JsonParser |
write(Buffer buffer)
Handle a
Buffer, pretty much like calling Handler.handle(Object). |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnewParser, newParserpipe, pipeTo, pipeTopublic JsonParserImpl(ReadStream<Buffer> stream)
public JsonParser pause()
ReadStreamReadStream, it sets the buffer in fetch mode and clears the actual demand.
While it's paused, no data will be sent to the data handler.
pause in interface JsonParserpause in interface ReadStream<JsonEvent>public JsonParser resume()
ReadStreamflowing mode.
If the ReadStream has been paused, reading will recommence on it.resume in interface JsonParserresume in interface ReadStream<JsonEvent>public JsonParser fetch(long amount)
ReadStreamamount of elements. If the ReadStream has been paused, reading will
recommence with the specified amount of items, otherwise the specified amount will
be added to the current stream demand.fetch in interface JsonParserfetch in interface ReadStream<JsonEvent>public JsonParser endHandler(Handler<Void> handler)
ReadStreamendHandler in interface JsonParserendHandler in interface ReadStream<JsonEvent>public JsonParser handler(Handler<JsonEvent> handler)
ReadStreamhandler in interface JsonParserhandler in interface ReadStream<JsonEvent>public void handle(Buffer event)
Handlerpublic void end()
JsonParserend in interface JsonParserpublic JsonParser objectEventMode()
JsonParserobjectEventMode in interface JsonParserpublic JsonParser objectValueMode()
JsonParserobjectValueMode in interface JsonParserpublic JsonParser arrayEventMode()
JsonParserarrayEventMode in interface JsonParserpublic JsonParser arrayValueMode()
JsonParserarrayValueMode in interface JsonParserpublic JsonParser write(Buffer buffer)
JsonParserBuffer, pretty much like calling Handler.handle(Object).write in interface JsonParserpublic JsonParser exceptionHandler(Handler<Throwable> handler)
ReadStreamexceptionHandler in interface JsonParserexceptionHandler in interface ReadStream<JsonEvent>exceptionHandler in interface StreamBasehandler - the exception handlerCopyright © 2020. All rights reserved.