interface JsonParser : Handler<Buffer>, ReadStream<JsonEvent>
A parser class which allows to incrementally parse json elements and emit json parse events instead of parsing a json element fully. This parser is convenient for parsing large json structures. The parser also parses concatenated json streams or line delimited json streams. The parser can also parse entire object or array when it is convenient, for instance a very large array of small objects can be parsed efficiently by handling array start/end and object events. Whenever the parser fails to parse or process the stream, the #exceptionHandler(Handler) is called with the cause of the failure and the current handling stops. After such event, the parser should not handle data anymore.
Author
Julien Viet
abstract fun arrayEventMode(): JsonParser
Flip the parser to emit a stream of events for each new json array. |
|
abstract fun arrayValueMode(): JsonParser
Flip the parser to emit a single value event for each new json array. Json array currently streamed won't be affected. |
|
abstract fun end(): Unit
End the stream, this must be called after all the json stream has been processed. |
|
abstract fun endHandler(endHandler: Handler<Void>): JsonParser |
|
abstract fun exceptionHandler(handler: Handler<Throwable>): JsonParser |
|
abstract fun handler(handler: Handler<JsonEvent>): JsonParser |
|
open static fun newParser(): JsonParseropen static fun newParser(stream: ReadStream<Buffer>): JsonParser
Create a new |
|
abstract fun objectEventMode(): JsonParser
Flip the parser to emit a stream of events for each new json object. |
|
abstract fun objectValueMode(): JsonParser
Flip the parser to emit a single value event for each new json object. Json object currently streamed won't be affected. |
|
abstract fun pause(): JsonParser |
|
abstract fun resume(): JsonParser |
|
abstract fun write(buffer: Buffer): JsonParser
Handle a |