java.lang.Object
tools.jackson.core.TSFBuilder<F,T>
tools.jackson.core.base.DecorableTSFactory.DecorableTSFBuilder<JsonFactory,JsonFactoryBuilder>
tools.jackson.core.json.JsonFactoryBuilder
public class JsonFactoryBuilder
extends DecorableTSFactory.DecorableTSFBuilder<JsonFactory,JsonFactoryBuilder>
TSFBuilder
implementation for constructing JsonFactory
instances for reading/writing JSON encoded content.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CharacterEscapesprotected intprotected charCharacter used for quoting Object Property names (if name quoting has not been disabled withJsonWriteFeature.QUOTE_PROPERTY_NAMES) and JSON String values.protected SerializableStringFields inherited from class tools.jackson.core.base.DecorableTSFactory.DecorableTSFBuilder
_generatorDecorators, _inputDecorator, _outputDecoratorFields inherited from class tools.jackson.core.TSFBuilder
_errorReportConfiguration, _factoryFeatures, _formatReadFeatures, _formatWriteFeatures, _recyclerPool, _streamReadConstraints, _streamReadFeatures, _streamWriteConstraints, _streamWriteFeatures -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Method for constructing actualTokenStreamFactoryinstance, given configuration.Method for defining custom escapes factory uses forJsonGenerators it creates.configure(JsonReadFeature f, boolean state) configure(JsonWriteFeature f, boolean state) The builder returned uses default settings more closely matching the default configs used in Jackson 2.x versions.disable(JsonReadFeature first, JsonReadFeature... other) disable(JsonWriteFeature first, JsonWriteFeature... other) enable(JsonReadFeature first, JsonReadFeature... other) enable(JsonWriteFeature first, JsonWriteFeature... other) inthighestNonEscapedChar(int maxNonEscaped) Method that allows specifying threshold beyond which all characters are automatically escaped (without checking possible custom escaping settings a lacharacterEscapes(tools.jackson.core.io.CharacterEscapes): for example, to force escaping of all non-ASCII characters (set to 127), or all non-Latin-1 character (set to 255).charquoteChar(char ch) Method that allows specifying an alternate character used for quoting Object Property names (if name quoting has not been disabled withJsonWriteFeature.QUOTE_PROPERTY_NAMES) and JSON String values.rootValueSeparator(String sep) Method that allows overriding String used for separating root-level JSON values (default is single space character)Method that allows overriding String used for separating root-level JSON values (default is single space character)Methods inherited from class tools.jackson.core.base.DecorableTSFactory.DecorableTSFBuilder
addDecorator, generatorDecorators, inputDecorator, inputDecorator, outputDecorator, outputDecoratorMethods inherited from class tools.jackson.core.TSFBuilder
_this, configure, configure, configure, disable, disable, disable, disable, disable, enable, enable, enable, enable, enable, errorReportConfiguration, factoryFeaturesMask, formatReadFeaturesMask, formatWriteFeaturesMask, recyclerPool, recyclerPool, streamReadConstraints, streamReadFeaturesMask, streamWriteConstraints, streamWriteFeaturesMask
-
Field Details
-
_characterEscapes
-
_rootValueSeparator
-
_maximumNonEscapedChar
protected int _maximumNonEscapedChar -
_quoteChar
protected char _quoteCharCharacter used for quoting Object Property names (if name quoting has not been disabled withJsonWriteFeature.QUOTE_PROPERTY_NAMES) and JSON String values.
-
-
Constructor Details
-
JsonFactoryBuilder
public JsonFactoryBuilder() -
JsonFactoryBuilder
-
-
Method Details
-
enable
-
enable
-
disable
-
disable
-
configure
-
enable
-
enable
-
disable
-
disable
-
configure
-
configureForJackson2
Description copied from class:TSFBuilderThe 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.
- Overrides:
configureForJackson2in classTSFBuilder<JsonFactory,JsonFactoryBuilder>
-
characterEscapes
Method for defining custom escapes factory uses forJsonGenerators it creates.- Parameters:
esc- CharacterEscapes to configure, if any;nullif none- Returns:
- This builder instance (to allow call chaining)
-
rootValueSeparator
Method that allows overriding String used for separating root-level JSON values (default is single space character)- Parameters:
sep- Separator to use, if any; null means that no separator is automatically added- Returns:
- This builder instance (to allow call chaining)
-
rootValueSeparator
Method that allows overriding String used for separating root-level JSON values (default is single space character)- Parameters:
sep- Separator to use, if any; null means that no separator is automatically added- Returns:
- This builder instance (to allow call chaining)
-
highestNonEscapedChar
Method that allows specifying threshold beyond which all characters are automatically escaped (without checking possible custom escaping settings a lacharacterEscapes(tools.jackson.core.io.CharacterEscapes): for example, to force escaping of all non-ASCII characters (set to 127), or all non-Latin-1 character (set to 255). Default setting is "disabled", specified by passing value of0(or negative numbers).NOTE! Lowest legal value (aside from marker 0) is 127: for ASCII range, other checks apply and this threshold is ignored. If value between [1, 126] is specified, 127 will be used instead.
- Parameters:
maxNonEscaped- Highest character code that is NOT automatically escaped; if positive value above 0, or 0 to indicate that no automatic escaping is applied beside from what JSON specification requires (and possible custom escape settings). Values between 1 and 127 are all taken to behave as if 127 is specified: that is, no automatic escaping is applied in ASCII range.- Returns:
- This builder instance (to allow call chaining)
-
quoteChar
Method that allows specifying an alternate character used for quoting Object Property names (if name quoting has not been disabled withJsonWriteFeature.QUOTE_PROPERTY_NAMES) and JSON String values.Default value is double-quote (
"); typical alternative is single-quote/apostrophe (').- Parameters:
ch- Character to use for quoting Object Property names and JSON String values.- Returns:
- This builder instance (to allow call chaining)
-
characterEscapes
-
rootValueSeparator
-
highestNonEscapedChar
public int highestNonEscapedChar() -
quoteChar
public char quoteChar() -
build
Description copied from class:TSFBuilderMethod for constructing actualTokenStreamFactoryinstance, given configuration.- Specified by:
buildin classTSFBuilder<JsonFactory,JsonFactoryBuilder> - Returns:
TokenStreamFactorybuild using builder configuration settings
-