Packages

class JsonParser extends ReadStream[JsonEvent] with Handler[Buffer]

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 io.vertx.scala.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.

Linear Supertypes
Handler[Buffer], ReadStream[JsonEvent], StreamBase, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JsonParser
  2. Handler
  3. ReadStream
  4. StreamBase
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new JsonParser(_asJava: AnyRef)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def arrayEventMode(): JsonParser

    Flip the parser to emit a stream of events for each new json array.

    Flip the parser to emit a stream of events for each new json array. * @return a reference to this, so the API can be used fluently

  5. def arrayValueMode(): JsonParser

    Flip the parser to emit a single value event for each new json array.

    Flip the parser to emit a single value event for each new json array.

    Json array currently streamed won't be affected. * @return a reference to this, so the API can be used fluently

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def asJava: AnyRef
    Definition Classes
    JsonParserReadStreamStreamBase
  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  9. def end(): Unit

    End the stream, this must be called after all the json stream has been processed.

  10. def endHandler(endHandler: Handler[Unit]): JsonParser

    Set an end handler.

    Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called. * @return a reference to this, so the API can be used fluently

    Definition Classes
    JsonParserReadStream
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  13. def exceptionHandler(handler: Handler[Throwable]): JsonParser

    Set an exception handler on the read stream.

    Set an exception handler on the read stream. * @param handler the exception handler

    returns

    a reference to this, so the API can be used fluently

    Definition Classes
    JsonParserReadStreamStreamBase
  14. def fetch(amount: Long): JsonParser

    Fetch the specified amount of elements.

    Fetch the specified amount 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. * @return a reference to this, so the API can be used fluently

    Definition Classes
    JsonParserReadStream
  15. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def handle(event: Buffer): Unit

    Something has happened, so handle it.

    Something has happened, so handle it. * @param event the event to handle

    Definition Classes
    JsonParser → Handler
  18. def handler(handler: Handler[JsonEvent]): JsonParser

    Set a data handler.

    Set a data handler. As data is read, the handler will be called with the data. * @return a reference to this, so the API can be used fluently

    Definition Classes
    JsonParserReadStream
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. def objectEventMode(): JsonParser

    Flip the parser to emit a stream of events for each new json object.

    Flip the parser to emit a stream of events for each new json object. * @return a reference to this, so the API can be used fluently

  25. def objectValueMode(): JsonParser

    Flip the parser to emit a single value event for each new json object.

    Flip the parser to emit a single value event for each new json object.

    Json object currently streamed won't be affected. * @return a reference to this, so the API can be used fluently

  26. def pause(): JsonParser

    Pause the ReadStream, it sets the buffer in fetch mode and clears the actual demand.

    Pause the ReadStream, 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. * @return a reference to this, so the API can be used fluently

    Definition Classes
    JsonParserReadStream
  27. def resume(): JsonParser

    Resume reading, and sets the buffer in flowing mode.

    Resume reading, and sets the buffer in flowing mode.

    If the ReadStream has been paused, reading will recommence on it. * @return a reference to this, so the API can be used fluently

    Definition Classes
    JsonParserReadStream
  28. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  29. def toString(): String
    Definition Classes
    AnyRef → Any
  30. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  33. def write(buffer: Buffer): JsonParser

    Handle a Buffer, pretty much like calling io.vertx.scala.core.Handler#handle.

    Handle a Buffer, pretty much like calling io.vertx.scala.core.Handler#handle. * @return a reference to this, so the API can be used fluently

Inherited from Handler[Buffer]

Inherited from ReadStream[JsonEvent]

Inherited from StreamBase

Inherited from AnyRef

Inherited from Any

Ungrouped