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 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.
- Alphabetic
- By Inheritance
- JsonParser
- Handler
- ReadStream
- StreamBase
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new JsonParser(_asJava: AnyRef)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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.
- returns
a reference to this, so the API can be used fluently
-
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.
- returns
a reference to this, so the API can be used fluently
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asJava: AnyRef
- Definition Classes
- JsonParser → ReadStream → StreamBase
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
end(): Unit
End the stream, this must be called after all the json stream has been processed.
-
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.
- returns
a reference to this, so the API can be used fluently
- Definition Classes
- JsonParser → ReadStream
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
exceptionHandler(handler: Handler[Throwable]): JsonParser
Set an exception handler on the read stream.
Set an exception handler on the read stream.
- handler
the exception handler
- returns
a reference to this, so the API can be used fluently
- Definition Classes
- JsonParser → ReadStream → StreamBase
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
handle(event: Buffer): Unit
Something has happened, so handle it.
Something has happened, so handle it.
- event
the event to handle
- Definition Classes
- JsonParser → Handler
-
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.
- returns
a reference to this, so the API can be used fluently
- Definition Classes
- JsonParser → ReadStream
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
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.
- returns
a reference to this, so the API can be used fluently
-
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.
- returns
a reference to this, so the API can be used fluently
-
def
pause(): JsonParser
Pause the
ReadSupport
.Pause the
ReadSupport
. While it's paused, no data will be sent to thedataHandler
- returns
a reference to this, so the API can be used fluently
- Definition Classes
- JsonParser → ReadStream
-
def
resume(): JsonParser
Resume reading.
Resume reading. If the
ReadSupport
has been paused, reading will recommence on it.- returns
a reference to this, so the API can be used fluently
- Definition Classes
- JsonParser → ReadStream
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
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.- returns
a reference to this, so the API can be used fluently