Package io.micronaut.jackson.parser
Class JacksonProcessor
- java.lang.Object
-
- io.micronaut.core.async.subscriber.SingleThreadedBufferingSubscriber<R>
-
- io.micronaut.core.async.processor.SingleThreadedBufferingProcessor<byte[],com.fasterxml.jackson.databind.JsonNode>
-
- io.micronaut.jackson.parser.JacksonProcessor
-
- All Implemented Interfaces:
io.micronaut.core.async.subscriber.Completable,io.micronaut.core.async.subscriber.Emitter<byte[]>,org.reactivestreams.Processor<byte[],com.fasterxml.jackson.databind.JsonNode>,org.reactivestreams.Publisher<com.fasterxml.jackson.databind.JsonNode>,org.reactivestreams.Subscriber<byte[]>
public class JacksonProcessor extends io.micronaut.core.async.processor.SingleThreadedBufferingProcessor<byte[],com.fasterxml.jackson.databind.JsonNode>A Reactive streams publisher that publishes aJsonNodeonce the JSON has been fully consumed. UsesNonBlockingJsonParserinternally allowing the parsing of JSON from an incoming stream of bytes in a non-blocking manner- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description JacksonProcessor()Default constructor.JacksonProcessor(com.fasterxml.jackson.core.JsonFactory jsonFactory)Construct with given JSON factory.JacksonProcessor(com.fasterxml.jackson.core.JsonFactory jsonFactory, boolean streamArray)Creates a new JacksonProcessor.JacksonProcessor(com.fasterxml.jackson.core.JsonFactory jsonFactory, boolean streamArray, com.fasterxml.jackson.databind.DeserializationConfig deserializationConfig)Creates a new JacksonProcessor.JacksonProcessor(com.fasterxml.jackson.core.JsonFactory jsonFactory, com.fasterxml.jackson.databind.DeserializationConfig deserializationConfig)Construct with given JSON factory.JacksonProcessor(com.fasterxml.jackson.databind.DeserializationConfig deserializationConfig)Construct with default JSON factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoOnComplete()booleanneedMoreInput()protected voidonUpstreamMessage(byte[] message)-
Methods inherited from class io.micronaut.core.async.processor.SingleThreadedBufferingProcessor
currentDownstreamSubscriber, doOnError, doOnNext, doOnSubscribe, getDownstreamSubscriber, subscribe, subscribeDownstream
-
Methods inherited from class io.micronaut.core.async.subscriber.SingleThreadedBufferingSubscriber
newDownstreamSubscription, onComplete, onError, onNext, onSubscribe, provideDownstreamSubscription
-
-
-
-
Constructor Detail
-
JacksonProcessor
public JacksonProcessor(com.fasterxml.jackson.core.JsonFactory jsonFactory, boolean streamArray, @Nullable com.fasterxml.jackson.databind.DeserializationConfig deserializationConfig)Creates a new JacksonProcessor.- Parameters:
jsonFactory- The JSON factorystreamArray- Whether arrays should be streameddeserializationConfig- The jackson deserialization configuration
-
JacksonProcessor
public JacksonProcessor(com.fasterxml.jackson.core.JsonFactory jsonFactory, boolean streamArray)Creates a new JacksonProcessor.- Parameters:
jsonFactory- The JSON factorystreamArray- Whether arrays should be streamed
-
JacksonProcessor
public JacksonProcessor(com.fasterxml.jackson.core.JsonFactory jsonFactory, com.fasterxml.jackson.databind.DeserializationConfig deserializationConfig)Construct with given JSON factory.- Parameters:
jsonFactory- To configure and construct reader (aka parser,JsonParser) and writer (aka generator,JsonGenerator) instances.deserializationConfig- The jackson deserialization configuration
-
JacksonProcessor
public JacksonProcessor(com.fasterxml.jackson.core.JsonFactory jsonFactory)
Construct with given JSON factory.- Parameters:
jsonFactory- To configure and construct reader (aka parser,JsonParser) and writer (aka generator,JsonGenerator) instances.
-
JacksonProcessor
public JacksonProcessor(com.fasterxml.jackson.databind.DeserializationConfig deserializationConfig)
Construct with default JSON factory.- Parameters:
deserializationConfig- The jackson deserialization configuration
-
JacksonProcessor
public JacksonProcessor()
Default constructor.
-
-
Method Detail
-
needMoreInput
public boolean needMoreInput()
- Returns:
- Whether more input is needed
-
doOnComplete
protected void doOnComplete()
- Overrides:
doOnCompletein classio.micronaut.core.async.processor.SingleThreadedBufferingProcessor<byte[],com.fasterxml.jackson.databind.JsonNode>
-
onUpstreamMessage
protected void onUpstreamMessage(byte[] message)
- Specified by:
onUpstreamMessagein classio.micronaut.core.async.processor.SingleThreadedBufferingProcessor<byte[],com.fasterxml.jackson.databind.JsonNode>
-
-