Package com.fasterxml.jackson.core

# Class TSFBuilder<F extends JsonFactory,B extends TSFBuilder<F,B>>

java.lang.Object
com.fasterxml.jackson.core.TSFBuilder<F,B>

Direct Known Subclasses:
  `JsonFactoryBuilder`

public abstract class TSFBuilder<F extends JsonFactory,B extends TSFBuilder<F,B>> extends Object
Since 2.10, Builder class is offered for creating token stream factories with difference configurations: with 3.x they will be fully immutable.

Since:
  2.10

## Field Summary

Fields
Modifier and Type
Field
Description
`protected ErrorReportConfiguration`
`_errorReportConfiguration`
`ErrorReportConfiguration` to use.
`protected int`
`_factoryFeatures`
Set of `JsonFactory.Feature`s enabled, as bitmask.
`protected List<JsonGeneratorDecorator>`
`_generatorDecorators`
`protected InputDecorator`
`_inputDecorator`
Optional helper object that may decorate input sources, to do additional processing on input during parsing.
`protected OutputDecorator`
`_outputDecorator`
Optional helper object that may decorate output object, to do additional processing on output during content generation.
`protected RecyclerPool<BufferRecycler>`
`_recyclerPool`
`protected StreamReadConstraints`
`_streamReadConstraints`
`StreamReadConstraints` to use.
`protected int`
`_streamReadFeatures`
Set of `JsonParser.Feature`s enabled, as bitmask.
`protected StreamWriteConstraints`
`_streamWriteConstraints`
`StreamWriteConstraints` to use.
`protected int`
`_streamWriteFeatures`
Set of `JsonGenerator.Feature`s enabled, as bitmask.
`protected static final int`
`DEFAULT_FACTORY_FEATURE_FLAGS`
Bitfield (set of flags) of all factory features that are enabled by default.
`protected static final int`
`DEFAULT_GENERATOR_FEATURE_FLAGS`
Bitfield (set of flags) of all generator features that are enabled by default.
`protected static final int`
`DEFAULT_PARSER_FEATURE_FLAGS`
Bitfield (set of flags) of all parser features that are enabled by default.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`TSFBuilder()`
`protected`
`TSFBuilder(int factoryFeatures, int parserFeatures, int generatorFeatures)`
`protected`
`TSFBuilder(JsonFactory base)`

## Method Summary

Modifier and Type
Method
Description
`protected static <T> List<T>`
`_copy(List<T> src)`
`protected void`
`_legacyDisable(JsonGenerator.Feature f)`
`protected void`
`_legacyDisable(JsonParser.Feature f)`
`protected void`
`_legacyEnable(JsonGenerator.Feature f)`
`protected void`
`_legacyEnable(JsonParser.Feature f)`
`protected final B`
`_this()`
`B`
`addDecorator(JsonGeneratorDecorator decorator)`
`abstract F`
`build()`
Method for constructing actual `TokenStreamFactory` instance, given configuration.
`B`
`configure(JsonReadFeature f, boolean state)`
`B`
`configure(JsonWriteFeature f, boolean state)`
`B`
`configure(JsonFactory.Feature f, boolean state)`
`B`
`configure(StreamReadFeature f, boolean state)`
`B`
`configure(StreamWriteFeature f, boolean state)`
`B`
`disable(JsonReadFeature f)`
`B`
`disable(JsonReadFeature first, JsonReadFeature... other)`
`B`
`disable(JsonWriteFeature f)`
`B`
`disable(JsonWriteFeature first, JsonWriteFeature... other)`
`B`
`disable(JsonFactory.Feature f)`
`B`
`disable(StreamReadFeature f)`
`B`
`disable(StreamReadFeature first, StreamReadFeature... other)`
`B`
`disable(StreamWriteFeature f)`
`B`
`disable(StreamWriteFeature first, StreamWriteFeature... other)`
`B`
`enable(JsonReadFeature f)`
`B`
`enable(JsonReadFeature first, JsonReadFeature... other)`
`B`
`enable(JsonWriteFeature f)`
`B`
`enable(JsonWriteFeature first, JsonWriteFeature... other)`
`B`
`enable(JsonFactory.Feature f)`
`B`
`enable(StreamReadFeature f)`
`B`
`enable(StreamReadFeature first, StreamReadFeature... other)`
`B`
`enable(StreamWriteFeature f)`
`B`
`enable(StreamWriteFeature first, StreamWriteFeature... other)`
`B`
`errorReportConfiguration(ErrorReportConfiguration errorReportConfiguration)`
Sets the configuration for error reporting.
`int`
`factoryFeaturesMask()`
`InputDecorator`
`inputDecorator()`
`B`
`inputDecorator(InputDecorator dec)`
`OutputDecorator`
`outputDecorator()`
`B`
`outputDecorator(OutputDecorator dec)`
`RecyclerPool<BufferRecycler>`
`recyclerPool()`
`B`
`recyclerPool(RecyclerPool<BufferRecycler> p)`
`B`
`streamReadConstraints(StreamReadConstraints streamReadConstraints)`
Sets the constraints for streaming reads.
`int`
`streamReadFeatures()`
`B`
`streamWriteConstraints(StreamWriteConstraints streamWriteConstraints)`
Sets the constraints for streaming writes.
`int`
`streamWriteFeatures()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### DEFAULT_FACTORY_FEATURE_FLAGS

protected static final int DEFAULT_FACTORY_FEATURE_FLAGS
Bitfield (set of flags) of all factory features that are enabled by default.

### DEFAULT_PARSER_FEATURE_FLAGS

protected static final int DEFAULT_PARSER_FEATURE_FLAGS
Bitfield (set of flags) of all parser features that are enabled by default.

### DEFAULT_GENERATOR_FEATURE_FLAGS

protected static final int DEFAULT_GENERATOR_FEATURE_FLAGS
Bitfield (set of flags) of all generator features that are enabled by default.

### _factoryFeatures

protected int _factoryFeatures
Set of `JsonFactory.Feature`s enabled, as bitmask.

### _streamReadFeatures

protected int _streamReadFeatures
Set of `JsonParser.Feature`s enabled, as bitmask.

### _streamWriteFeatures

protected int _streamWriteFeatures
Set of `JsonGenerator.Feature`s enabled, as bitmask.

### _recyclerPool

protected RecyclerPool<BufferRecycler> _recyclerPool

Since:
  2.16

### _inputDecorator

protected InputDecorator _inputDecorator
Optional helper object that may decorate input sources, to do additional processing on input during parsing.

### _outputDecorator

protected OutputDecorator _outputDecorator
Optional helper object that may decorate output object, to do additional processing on output during content generation.

### _streamReadConstraints

protected StreamReadConstraints _streamReadConstraints
`StreamReadConstraints` to use.

Since:
  2.15

### _streamWriteConstraints

protected StreamWriteConstraints _streamWriteConstraints
`StreamWriteConstraints` to use.

Since:
  2.16

### _errorReportConfiguration

protected ErrorReportConfiguration _errorReportConfiguration
`ErrorReportConfiguration` to use.

Since:
  2.16

### _generatorDecorators

protected List<JsonGeneratorDecorator> _generatorDecorators

Since:
  2.16

## Constructor Details

### TSFBuilder

protected TSFBuilder()

### TSFBuilder

protected TSFBuilder(JsonFactory base)

### TSFBuilder

protected TSFBuilder(int factoryFeatures, int parserFeatures, int generatorFeatures)

## Method Details

### _copy

protected static <T> List<T> _copy(List<T> src)

### factoryFeaturesMask

public int factoryFeaturesMask()

### streamReadFeatures

public int streamReadFeatures()

### streamWriteFeatures

public int streamWriteFeatures()

### recyclerPool

public RecyclerPool<BufferRecycler> recyclerPool()

### inputDecorator

public InputDecorator inputDecorator()

### outputDecorator

public OutputDecorator outputDecorator()

### enable

public B enable(JsonFactory.Feature f)

### disable

public B disable(JsonFactory.Feature f)

### configure

public B configure(JsonFactory.Feature f, boolean state)

### enable

public B enable(StreamReadFeature f)

### enable

public B enable(StreamReadFeature first, StreamReadFeature... other)

### disable

public B disable(StreamReadFeature f)

### disable

public B disable(StreamReadFeature first, StreamReadFeature... other)

### configure

public B configure(StreamReadFeature f, boolean state)

### enable

public B enable(StreamWriteFeature f)

### enable

public B enable(StreamWriteFeature first, StreamWriteFeature... other)

### disable

public B disable(StreamWriteFeature f)

### disable

public B disable(StreamWriteFeature first, StreamWriteFeature... other)

### configure

public B configure(StreamWriteFeature f, boolean state)

### enable

public B enable(JsonReadFeature f)

### enable

public B enable(JsonReadFeature first, JsonReadFeature... other)

### disable

public B disable(JsonReadFeature f)

### disable

public B disable(JsonReadFeature first, JsonReadFeature... other)

### configure

public B configure(JsonReadFeature f, boolean state)

### enable

public B enable(JsonWriteFeature f)

### enable

public B enable(JsonWriteFeature first, JsonWriteFeature... other)

### disable

public B disable(JsonWriteFeature f)

### disable

public B disable(JsonWriteFeature first, JsonWriteFeature... other)

### configure

public B configure(JsonWriteFeature f, boolean state)

### recyclerPool

public B recyclerPool(RecyclerPool<BufferRecycler> p)

Parameters:
  `p` - RecyclerPool to use for buffer allocation
Returns:
  this builder (for call chaining)
Since:
  2.16

### inputDecorator

public B inputDecorator(InputDecorator dec)

### outputDecorator

public B outputDecorator(OutputDecorator dec)

### addDecorator

public B addDecorator(JsonGeneratorDecorator decorator)

### streamReadConstraints

public B streamReadConstraints(StreamReadConstraints streamReadConstraints)
Sets the constraints for streaming reads.

Parameters:
  `streamReadConstraints` - constraints for streaming reads
Returns:
  this builder (for call chaining)
Since:
  2.15

### streamWriteConstraints

public B streamWriteConstraints(StreamWriteConstraints streamWriteConstraints)
Sets the constraints for streaming writes.

Parameters:
  `streamWriteConstraints` - constraints for streaming reads
Returns:
  this builder (for call chaining)
Since:
  2.16

### errorReportConfiguration

public B errorReportConfiguration(ErrorReportConfiguration errorReportConfiguration)
Sets the configuration for error reporting.

Parameters:
  `errorReportConfiguration` - configuration values used for handling erroneous token inputs.
Returns:
  this builder (for call chaining)
Since:
  2.16

### build

public abstract F build()
Method for constructing actual `TokenStreamFactory` instance, given configuration.

Returns:
  `TokenStreamFactory` build based on current configuration

### _this

protected final B _this()

### _legacyEnable

protected void _legacyEnable(JsonParser.Feature f)

### _legacyDisable

protected void _legacyDisable(JsonParser.Feature f)

### _legacyEnable

protected void _legacyEnable(JsonGenerator.Feature f)

### _legacyDisable

protected void _legacyDisable(JsonGenerator.Feature f)