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:
- Completable,- Emitter<byte[]>,- Processor<byte[],,- com.fasterxml.jackson.databind.JsonNode> - Publisher<com.fasterxml.jackson.databind.JsonNode>,- Subscriber<byte[]>
public class JacksonProcessor
extends SingleThreadedBufferingProcessor<byte[],com.fasterxml.jackson.databind.JsonNode> 
A Reactive streams publisher that publishes a 
JsonNode once the JSON has been fully consumed.
 Uses NonBlockingJsonParser internally allowing the parsing of
 JSON from an incoming stream of bytes in a non-blocking manner- Since:
- 1.0
- Author:
- Graeme Rocher
- 
Nested Class SummaryNested classes/interfaces inherited from class io.micronaut.core.async.subscriber.SingleThreadedBufferingSubscriberSingleThreadedBufferingSubscriber.BackPressureState, SingleThreadedBufferingSubscriber.DownstreamSubscription
- 
Field SummaryFields inherited from class io.micronaut.core.async.subscriber.SingleThreadedBufferingSubscriberupstreamBuffer, upstreamDemand, upstreamState, upstreamSubscription
- 
Constructor SummaryConstructorsConstructorDescriptionDefault 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, @Nullable 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 SummaryModifier and TypeMethodDescriptionprotected voidImplementSubscriber.onComplete().booleanprotected voidonUpstreamMessage(byte[] message) Called when a message is received from the upstreamSubscriber.Methods inherited from class io.micronaut.core.async.processor.SingleThreadedBufferingProcessorcurrentDownstreamSubscriber, doOnError, doOnNext, doOnSubscribe, getDownstreamSubscriber, subscribe, subscribeDownstreamMethods inherited from class io.micronaut.core.async.subscriber.SingleThreadedBufferingSubscribernewDownstreamSubscription, onComplete, onError, onNext, onSubscribe, provideDownstreamSubscriptionMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.reactivestreams.SubscriberonComplete, onError, onNext, onSubscribe
- 
Constructor Details- 
JacksonProcessorpublic JacksonProcessor(com.fasterxml.jackson.core.JsonFactory jsonFactory, boolean streamArray, @Nullable @Nullable com.fasterxml.jackson.databind.DeserializationConfig deserializationConfig) Creates a new JacksonProcessor.- Parameters:
- jsonFactory- The JSON factory
- streamArray- Whether arrays should be streamed
- deserializationConfig- The jackson deserialization configuration
 
- 
JacksonProcessorpublic JacksonProcessor(com.fasterxml.jackson.core.JsonFactory jsonFactory, boolean streamArray) Creates a new JacksonProcessor.- Parameters:
- jsonFactory- The JSON factory
- streamArray- Whether arrays should be streamed
 
- 
JacksonProcessorpublic 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
 
- 
JacksonProcessorpublic 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.
 
- 
JacksonProcessorpublic JacksonProcessor(com.fasterxml.jackson.databind.DeserializationConfig deserializationConfig) Construct with default JSON factory.- Parameters:
- deserializationConfig- The jackson deserialization configuration
 
- 
JacksonProcessorpublic JacksonProcessor()Default constructor.
 
- 
- 
Method Details- 
needMoreInputpublic boolean needMoreInput()- Returns:
- Whether more input is needed
 
- 
doOnCompleteprotected void doOnComplete()Description copied from class:SingleThreadedBufferingSubscriberImplementSubscriber.onComplete().- Overrides:
- doOnCompletein class- SingleThreadedBufferingProcessor<byte[],- com.fasterxml.jackson.databind.JsonNode> 
 
- 
onUpstreamMessageprotected void onUpstreamMessage(byte[] message) Description copied from class:SingleThreadedBufferingProcessorCalled when a message is received from the upstreamSubscriber.- Specified by:
- onUpstreamMessagein class- SingleThreadedBufferingProcessor<byte[],- com.fasterxml.jackson.databind.JsonNode> 
- Parameters:
- message- The message
 
 
-