Module tools.jackson.core
Package tools.jackson.core
Class TSFBuilder<F extends TokenStreamFactory,B extends TSFBuilder<F,B>>
java.lang.Object
tools.jackson.core.TSFBuilder<F,B>
- Direct Known Subclasses:
DecorableTSFactory.DecorableTSFBuilder
public abstract class TSFBuilder<F extends TokenStreamFactory,B extends TSFBuilder<F,B>>
extends Object
Since factory instances are immutable, a Builder class is needed for creating
configurations for differently configured factory instances.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ErrorReportConfigurationErrorReportConfigurationto use.protected intSet ofTokenStreamFactory.Features enabled, as bitmask.protected intSet of format-specific readFormatFeatures enabled, as bitmask.protected intSet of format-specific writeFormatFeatures enabled, as bitmask.protected RecyclerPool<BufferRecycler>Buffer recycler provider to use.protected StreamReadConstraintsStreamReadConstraints to use.protected intSet ofStreamReadFeatures enabled, as bitmask.protected StreamWriteConstraintsStreamWriteConstraints to use.protected intSet ofStreamWriteFeatures enabled, as bitmask. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTSFBuilder(StreamReadConstraints src, StreamWriteConstraints swc, ErrorReportConfiguration erc, int formatReadF, int formatWriteF) protectedTSFBuilder(TokenStreamFactory base) protectedTSFBuilder(RecyclerPool<BufferRecycler> brp, StreamReadConstraints src, StreamWriteConstraints swc, ErrorReportConfiguration erc, int factoryFeatures, int streamReadFeatures, int streamWriteFeatures, int formatReadFeatures, int formatWriteFeatures) -
Method Summary
Modifier and TypeMethodDescriptionprotected final B_this()abstract Fbuild()Method for constructing actualTokenStreamFactoryinstance, given configuration.configure(StreamReadFeature f, boolean state) configure(StreamWriteFeature f, boolean state) configure(TokenStreamFactory.Feature f, boolean state) The builder returned uses default settings more closely matching the default configs used in Jackson 2.x versions.disable(StreamReadFeature first, StreamReadFeature... other) disable(StreamWriteFeature first, StreamWriteFeature... other) enable(StreamReadFeature first, StreamReadFeature... other) enable(StreamWriteFeature first, StreamWriteFeature... other) errorReportConfiguration(ErrorReportConfiguration errorReportConfiguration) Sets the configuration for error tokens.intintintstreamReadConstraints(StreamReadConstraints streamReadConstraints) Sets the constraints for streaming reads.intstreamWriteConstraints(StreamWriteConstraints streamWriteConstraints) Sets the constraints for streaming writes.int
-
Field Details
-
_factoryFeatures
protected int _factoryFeaturesSet ofTokenStreamFactory.Features enabled, as bitmask. -
_streamReadFeatures
protected int _streamReadFeaturesSet ofStreamReadFeatures enabled, as bitmask. -
_streamWriteFeatures
protected int _streamWriteFeaturesSet ofStreamWriteFeatures enabled, as bitmask. -
_formatReadFeatures
protected int _formatReadFeaturesSet of format-specific readFormatFeatures enabled, as bitmask. -
_formatWriteFeatures
protected int _formatWriteFeaturesSet of format-specific writeFormatFeatures enabled, as bitmask. -
_recyclerPool
Buffer recycler provider to use. -
_streamReadConstraints
StreamReadConstraints to use. -
_streamWriteConstraints
StreamWriteConstraints to use. -
_errorReportConfiguration
ErrorReportConfigurationto use.
-
-
Constructor Details
-
TSFBuilder
protected TSFBuilder(StreamReadConstraints src, StreamWriteConstraints swc, ErrorReportConfiguration erc, int formatReadF, int formatWriteF) -
TSFBuilder
-
TSFBuilder
protected TSFBuilder(RecyclerPool<BufferRecycler> brp, StreamReadConstraints src, StreamWriteConstraints swc, ErrorReportConfiguration erc, int factoryFeatures, int streamReadFeatures, int streamWriteFeatures, int formatReadFeatures, int formatWriteFeatures)
-
-
Method Details
-
factoryFeaturesMask
public int factoryFeaturesMask() -
streamReadFeaturesMask
public int streamReadFeaturesMask() -
streamWriteFeaturesMask
public int streamWriteFeaturesMask() -
formatReadFeaturesMask
public int formatReadFeaturesMask() -
formatWriteFeaturesMask
public int formatWriteFeaturesMask() -
recyclerPool
-
enable
-
disable
-
configure
-
enable
-
enable
-
disable
-
disable
-
configure
-
enable
-
enable
-
disable
-
disable
-
configure
-
configureForJackson2
The builder returned uses default settings more closely matching the default configs used in Jackson 2.x versions.This method is still a work in progress and may not yet fully replicate the default settings of Jackson 2.x.
-
streamReadConstraints
Sets the constraints for streaming reads.- Parameters:
streamReadConstraints- constraints for streaming reads- Returns:
- this builder
-
streamWriteConstraints
Sets the constraints for streaming writes.- Parameters:
streamWriteConstraints- constraints for streaming writes- Returns:
- this builder
-
errorReportConfiguration
Sets the configuration for error tokens.- Parameters:
errorReportConfiguration- configuration values used for handling errorneous token inputs.- Returns:
- this builder
-
recyclerPool
- Parameters:
p- RecyclerPool to use for buffer allocation- Returns:
- this builder (for call chaining)
-
build
Method for constructing actualTokenStreamFactoryinstance, given configuration.- Returns:
TokenStreamFactorybuild using builder configuration settings
-
_this
-