Class JsonParser
- All Implemented Interfaces:
MutinyDelegate,io.vertx.core.Handler<io.vertx.core.buffer.Buffer>,ReadStream<io.vertx.core.parsetools.JsonEvent>,StreamBase,Consumer<io.vertx.core.buffer.Buffer>
#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.
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Julien Viet
- See Also:
-
JsonParser
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vertx.mutiny.core.streams.ReadStream
ReadStream.ReadStreamImpl<T>Nested classes/interfaces inherited from interface io.vertx.mutiny.core.streams.StreamBase
StreamBase.StreamBaseImpl -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJsonParser(io.vertx.core.parsetools.JsonParser delegate) Create a new instance ofJsonParserdelegating to the given (non-null) instance ofJsonParser.JsonParser(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(io.vertx.core.buffer.Buffer item) Handle an item.Flip the parser to emit a stream of events for each new json array.Flip the parser to emit a single value event for each new json array.voidend()End the stream, this must be called after all the json stream has been processed.endHandler(Runnable endHandler) Set an end handler.booleanexceptionHandler(Consumer<Throwable> handler) Set an exception handler on the read stream.fetch(long amount) Fetch the specifiedamountof elements.io.vertx.core.parsetools.JsonParserGet the delegate instance.voidhandle(io.vertx.core.buffer.Buffer item) Handle an item.Set a data handler.inthashCode()static JsonParsernewInstance(io.vertx.core.parsetools.JsonParser delegate) Creates a new instance of theJsonParser.static JsonParserCreate a newJsonParserinstance.static JsonParsernewParser(ReadStream<io.vertx.core.buffer.Buffer> stream) Create a newJsonParserinstance.static JsonParsernewParser(Flow.Publisher<io.vertx.core.buffer.Buffer> stream) Create a newJsonParserinstance.Flip the parser to emit a stream of events for each new json object.Flip the parser to emit a single value event for each new json object.pause()Pause theReadStream, it sets the buffer infetchmode and clears the actual demand.Pipe<io.vertx.core.parsetools.JsonEvent>pipe()Pause this stream and return aPipeto transfer the elements of this stream to a destinationWriteStream.io.smallrye.mutiny.Uni<Void>pipeTo(WriteStream<io.vertx.core.parsetools.JsonEvent> arg0) Pipe thisReadStreamto theWriteStream.voidpipeToAndAwait(WriteStream<io.vertx.core.parsetools.JsonEvent> arg0) Pipe thisReadStreamto theWriteStream.pipeToAndForget(WriteStream<io.vertx.core.parsetools.JsonEvent> arg0) Pipe thisReadStreamto theWriteStream.resume()Resume reading, and sets the buffer inflowingmode.Iterable<io.vertx.core.parsetools.JsonEvent>Stream<io.vertx.core.parsetools.JsonEvent>io.smallrye.mutiny.Multi<io.vertx.core.parsetools.JsonEvent>toMulti()toString()write(io.vertx.core.buffer.Buffer buffer) Handle aBuffer, pretty much like callingHandler.handle(Object).
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
JsonParser
public JsonParser(io.vertx.core.parsetools.JsonParser delegate) Create a new instance ofJsonParserdelegating to the given (non-null) instance ofJsonParser. -
JsonParser
-
-
Method Details
-
accept
public void accept(io.vertx.core.buffer.Buffer item) Handle an item. This method is generated from theoriginalmethod." -
handle
public void handle(io.vertx.core.buffer.Buffer item) Handle an item. This method is generated from theoriginalmethod."- Specified by:
handlein interfaceio.vertx.core.Handler<io.vertx.core.buffer.Buffer>
-
getDelegate
public io.vertx.core.parsetools.JsonParser getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Specified by:
getDelegatein interfaceReadStream<io.vertx.core.parsetools.JsonEvent>- Specified by:
getDelegatein interfaceStreamBase- Returns:
- the delegate instance
-
pipeTo
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> pipeTo(WriteStream<io.vertx.core.parsetools.JsonEvent> arg0) Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
pipeToin interfaceReadStream<io.vertx.core.parsetools.JsonEvent>- Parameters:
dst- the destination write stream- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
io.vertx.core.parsetools.JsonParser#pipeTo(WriteStream)
-
pipeToAndAwait
Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
dst- the destination write stream- See Also:
-
io.vertx.core.parsetools.JsonParser#pipeTo(WriteStream)
-
pipeToAndForget
Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
dst- the destination write stream- Returns:
- The current instance to chain operations if needed.
- See Also:
-
io.vertx.core.parsetools.JsonParser#pipeTo(WriteStream)
-
newParser
Create a newJsonParserinstance. -
newParser
Create a newJsonParserinstance. -
newParser
Create a newJsonParserinstance. -
write
Handle aBuffer, pretty much like callingHandler.handle(Object).- Returns:
- a reference to this, so the API can be used fluently
-
end
public void end()End the stream, this must be called after all the json stream has been processed. -
objectEventMode
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
-
objectValueMode
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
-
arrayEventMode
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
-
arrayValueMode
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
-
pause
Description copied from interface:ReadStreamPause theReadStream, it sets the buffer infetchmode and clears the actual demand.While it's paused, no data will be sent to the data
handler.- Specified by:
pausein interfaceReadStream<io.vertx.core.parsetools.JsonEvent>- Returns:
- a reference to this, so the API can be used fluently
-
resume
Description copied from interface:ReadStreamResume reading, and sets the buffer inflowingmode. If theReadStreamhas been paused, reading will recommence on it.- Specified by:
resumein interfaceReadStream<io.vertx.core.parsetools.JsonEvent>- Returns:
- a reference to this, so the API can be used fluently
-
fetch
Description copied from interface:ReadStreamFetch the specifiedamountof elements. If theReadStreamhas been paused, reading will recommence with the specifiedamountof items, otherwise the specifiedamountwill be added to the current stream demand.- Specified by:
fetchin interfaceReadStream<io.vertx.core.parsetools.JsonEvent>- Returns:
- a reference to this, so the API can be used fluently
-
endHandler
Description copied from interface:ReadStreamSet an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.- Specified by:
endHandlerin interfaceReadStream<io.vertx.core.parsetools.JsonEvent>- Returns:
- a reference to this, so the API can be used fluently
-
handler
Description copied from interface:ReadStreamSet a data handler. As data is read, the handler will be called with the data.- Specified by:
handlerin interfaceReadStream<io.vertx.core.parsetools.JsonEvent>- Returns:
- a reference to this, so the API can be used fluently
-
exceptionHandler
Description copied from interface:ReadStreamSet an exception handler on the read stream.- Specified by:
exceptionHandlerin interfaceReadStream<io.vertx.core.parsetools.JsonEvent>- Specified by:
exceptionHandlerin interfaceStreamBase- Parameters:
handler- the exception handler. Can benull.- Returns:
- a reference to this, so the API can be used fluently
-
pipe
Pause this stream and return aPipeto transfer the elements of this stream to a destinationWriteStream. The stream will be resumed when the pipe will be wired to aWriteStream.- Specified by:
pipein interfaceReadStream<io.vertx.core.parsetools.JsonEvent>- Returns:
- a pipe
-
newInstance
Creates a new instance of theJsonParser. -
hashCode
public int hashCode() -
equals
-
toString
-
toMulti
@CheckReturnValue public io.smallrye.mutiny.Multi<io.vertx.core.parsetools.JsonEvent> toMulti() -
toBlockingIterable
-
toBlockingStream
-