java.lang.Object
tools.jackson.core.TokenStreamFactory
tools.jackson.core.base.DecorableTSFactory
- All Implemented Interfaces:
Serializable,Snapshottable<TokenStreamFactory>,Versioned
- Direct Known Subclasses:
BinaryTSFactory,TextualTSFactory
Intermediate base
TokenStreamFactory implementation that offers support for
streams that allow decoration of low-level input sources and output targets.- Since:
- 3.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDecorableTSFactory.DecorableTSFBuilder<F extends TokenStreamFactory,T extends TSFBuilder<F, T>> Since factory instances are immutable, a Builder class is needed for creating configurations for differently configured factory instances.Nested classes/interfaces inherited from class tools.jackson.core.TokenStreamFactory
TokenStreamFactory.Feature -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<JsonGeneratorDecorator> protected final InputDecoratorOptional helper object that may decorate input sources, to do additional processing on input during parsing.protected final OutputDecoratorOptional helper object that may decorate output object, to do additional processing on output during content generation.Fields inherited from class tools.jackson.core.TokenStreamFactory
_errorReportConfiguration, _factoryFeatures, _formatReadFeatures, _formatWriteFeatures, _recyclerPool, _streamReadConstraints, _streamReadFeatures, _streamWriteConstraints, _streamWriteFeatures, DEFAULT_FACTORY_FEATURE_FLAGS, DEFAULT_STREAM_READ_FEATURE_FLAGS, DEFAULT_STREAM_WRITE_FEATURE_FLAGS, EMPTY_WRITE_CONTEXT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedDecorableTSFactory(DecorableTSFactory.DecorableTSFBuilder<?, ?> baseBuilder) Constructor used by builders for instantiation.protectedDecorableTSFactory(StreamReadConstraints src, StreamWriteConstraints swc, ErrorReportConfiguration erc, int formatPF, int formatGF) -
Method Summary
Modifier and TypeMethodDescriptionprotected static void_closeOnFailedConstruction(Closeable toClose, Closeable rawFallback, RuntimeException failure) Variant of_closeOnFailedConstruction(Closeable, RuntimeException)for case where the resource to close may wrap (decorate) the source/target Jackson opened: closing the outermost resource is expected to close what it wraps, so underlying resource is only closed if closing of the outermost one failed.protected static void_closeOnFailedConstruction(Closeable toClose, RuntimeException failure) protected static <T> List<T> protected DataInputprotected InputStream_decorate(IOContext ioCtxt, InputStream in) protected OutputStream_decorate(IOContext ioCtxt, OutputStream out) protected Readerprotected Writerprotected JsonGenerator_decorate(JsonGenerator result) protected static void_releaseOnFailedConstruction(IOContext ioCtxt, RuntimeException failure) Method called when construction of parser or generator fails: releasesIOContextso thatBufferRecyclerit leased gets returned to the pool.Methods inherited from class tools.jackson.core.TokenStreamFactory
_checkRangeBoundsForByteArray, _checkRangeBoundsForCharArray, _createContentReference, _createContentReference, _createContext, _createContext, _createDataOutputWrapper, _fileInputStream, _fileOutputStream, _getBufferRecycler, _getRecyclerPool, _optimizedStreamFromURL, _pathInputStream, _pathOutputStream, _reportRangeError, _unsupported, _unsupported, _wrapIOFailure, canHandleBinaryNatively, canParseAsync, canUseSchema, constructCINameMatcher, constructNameMatcher, copy, createGenerator, createGenerator, createGenerator, createGenerator, createGenerator, createGenerator, createGenerator, createGenerator, createGenerator, createNonBlockingByteArrayParser, createNonBlockingByteBufferParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, errorReportConfiguration, getFactoryFeatures, getFormatName, getFormatReadFeatures, getFormatReadFeatureType, getFormatWriteFeatures, getFormatWriteFeatureType, getStreamReadFeatures, getStreamWriteFeatures, isEnabled, isEnabled, isEnabled, rebuild, requiresPropertyOrdering, snapshot, streamReadConstraints, streamWriteConstraints, version
-
Field Details
-
_inputDecorator
Optional helper object that may decorate input sources, to do additional processing on input during parsing. -
_outputDecorator
Optional helper object that may decorate output object, to do additional processing on output during content generation. -
_generatorDecorators
-
-
Constructor Details
-
DecorableTSFactory
protected DecorableTSFactory(StreamReadConstraints src, StreamWriteConstraints swc, ErrorReportConfiguration erc, int formatPF, int formatGF) -
DecorableTSFactory
Constructor used by builders for instantiation.- Parameters:
baseBuilder- Builder with configurations to use- Since:
- 3.0
-
DecorableTSFactory
-
-
Method Details
-
_copy
-
getOutputDecorator
-
getInputDecorator
-
getGeneratorDecorators
-
_decorate
- Throws:
JacksonException
-
_decorate
- Throws:
JacksonException
-
_decorate
- Throws:
JacksonException
-
_decorate
- Throws:
JacksonException
-
_decorate
- Throws:
JacksonException
-
_decorate
-
_releaseOnFailedConstruction
Method called when construction of parser or generator fails: releasesIOContextso thatBufferRecyclerit leased gets returned to the pool. Without this the lease is simply dropped, since context is otherwise only released when parser or generator that owns it gets closed.- Parameters:
ioCtxt- Context to release, if any (nullif not yet created)failure- Failure to add possible secondary failure to, as suppressed- Since:
- 3.1.7
-
_closeOnFailedConstruction
Method called when construction of parser or generator fails after Jackson has opened source or target itself (fromFileorPath): closes it so that it does not get leaked. Caller-provided sources and targets are never passed here.- Parameters:
toClose- Source/target Jackson opened, if any (nullif not yet opened)failure- Failure to add possible secondary failure to, as suppressed- Since:
- 3.1.7
-
_closeOnFailedConstruction
protected static void _closeOnFailedConstruction(Closeable toClose, Closeable rawFallback, RuntimeException failure) Variant of_closeOnFailedConstruction(Closeable, RuntimeException)for case where the resource to close may wrap (decorate) the source/target Jackson opened: closing the outermost resource is expected to close what it wraps, so underlying resource is only closed if closing of the outermost one failed.- Parameters:
toClose- Outermost source/target to close, if any (nullif not yet opened)rawFallback- Source/target Jackson opened: closed if, and only if, closing oftoClosefailedfailure- Failure to add possible secondary failure to, as suppressed- Since:
- 3.1.7
-