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 @see \io\vertx\jphp\core\parsetools\JsonParser::exceptionHandler is called with the cause of the failure and the current handling stops. After such event, the parser should not handle data anymore.
package |
Default |
---|
__construct()
arrayEventMode() : $this
$this
a reference to this, so the API can be used fluently
arrayValueMode() : $this
$this
a reference to this, so the API can be used fluently
end() : void
endHandler( $arg0) : $this
callable
$this
exceptionHandler( $arg0) : $this
callable
$this
fetch( $arg0) : $this
integer
$this
handle( $arg0) : void
Buffer
handler( $arg0) : $this
callable
$this
newParser( $arg0 = null) : \io\vertx\jphp\core\parsetools\JsonParser
newParser()
Create a new JsonParser
instance.
param $stream [ReadStream
ReadStream
\io\vertx\jphp\core\parsetools\JsonParser
objectEventMode() : $this
$this
a reference to this, so the API can be used fluently
objectValueMode() : $this
$this
a reference to this, so the API can be used fluently
pause() : $this
$this
resume() : $this
$this
write( $arg0) : $this
Buffer
$this
a reference to this, so the API can be used fluently