Package com.fasterxml.jackson.core
Class JsonFactoryBuilder
- java.lang.Object
-
- com.fasterxml.jackson.core.TSFBuilder<JsonFactory,JsonFactoryBuilder>
-
- com.fasterxml.jackson.core.JsonFactoryBuilder
-
public class JsonFactoryBuilder extends TSFBuilder<JsonFactory,JsonFactoryBuilder>
TSFBuilderimplementation for constructing vanillaJsonFactoryinstances for reading/writing JSON encoded content.NOTE: as of Jackson 2.x, use of JSON-specific builder is bit cumbersome since
JsonFactoryserves dual duty of base class AND actual implementation for JSON backend. This will be fixed in Jackson 3.0.- Since:
- 2.10
-
-
Constructor Summary
Constructors Constructor Description JsonFactoryBuilder()JsonFactoryBuilder(JsonFactory base)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonFactorybuild()Method for constructing actualTokenStreamFactoryinstance, given configuration.CharacterEscapescharacterEscapes()JsonFactoryBuildercharacterEscapes(CharacterEscapes esc)Method for defining custom escapes factory uses forJsonGenerators it creates.JsonFactoryBuilderconfigure(JsonReadFeature f, boolean state)JsonFactoryBuilderconfigure(JsonWriteFeature f, boolean state)JsonFactoryBuilderdisable(JsonReadFeature f)JsonFactoryBuilderdisable(JsonReadFeature first, JsonReadFeature... other)JsonFactoryBuilderdisable(JsonWriteFeature f)JsonFactoryBuilderdisable(JsonWriteFeature first, JsonWriteFeature... other)JsonFactoryBuilderenable(JsonReadFeature f)JsonFactoryBuilderenable(JsonReadFeature first, JsonReadFeature... other)JsonFactoryBuilderenable(JsonWriteFeature f)JsonFactoryBuilderenable(JsonWriteFeature first, JsonWriteFeature... other)inthighestNonEscapedChar()JsonFactoryBuilderhighestNonEscapedChar(int maxNonEscaped)Method that allows specifying threshold beyond which all characters are automatically escaped (without checking possible custom escaping settings a lacharacterEscapes(com.fasterxml.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()JsonFactoryBuilderquoteChar(char ch)Method that allows specifying an alternate character used for quoting field names (if field name quoting has not been disabled withJsonWriteFeature.QUOTE_FIELD_NAMES) and JSON String values.SerializableStringrootValueSeparator()JsonFactoryBuilderrootValueSeparator(SerializableString sep)Method that allows overriding String used for separating root-level JSON values (default is single space character)JsonFactoryBuilderrootValueSeparator(java.lang.String sep)Method that allows overriding String used for separating root-level JSON values (default is single space character)-
Methods inherited from class com.fasterxml.jackson.core.TSFBuilder
addDecorator, configure, configure, configure, disable, disable, disable, disable, disable, enable, enable, enable, enable, enable, errorReportConfiguration, factoryFeaturesMask, inputDecorator, inputDecorator, outputDecorator, outputDecorator, recyclerPool, recyclerPool, streamReadConstraints, streamReadFeatures, streamWriteConstraints, streamWriteFeatures
-
-
-
-
Constructor Detail
-
JsonFactoryBuilder
public JsonFactoryBuilder()
-
JsonFactoryBuilder
public JsonFactoryBuilder(JsonFactory base)
-
-
Method Detail
-
enable
public JsonFactoryBuilder enable(JsonReadFeature f)
- Overrides:
enablein classTSFBuilder<JsonFactory,JsonFactoryBuilder>
-
enable
public JsonFactoryBuilder enable(JsonReadFeature first, JsonReadFeature... other)
- Overrides:
enablein classTSFBuilder<JsonFactory,JsonFactoryBuilder>
-
disable
public JsonFactoryBuilder disable(JsonReadFeature f)
- Overrides:
disablein classTSFBuilder<JsonFactory,JsonFactoryBuilder>
-
disable
public JsonFactoryBuilder disable(JsonReadFeature first, JsonReadFeature... other)
- Overrides:
disablein classTSFBuilder<JsonFactory,JsonFactoryBuilder>
-
configure
public JsonFactoryBuilder configure(JsonReadFeature f, boolean state)
- Overrides:
configurein classTSFBuilder<JsonFactory,JsonFactoryBuilder>
-
enable
public JsonFactoryBuilder enable(JsonWriteFeature f)
- Overrides:
enablein classTSFBuilder<JsonFactory,JsonFactoryBuilder>
-
enable
public JsonFactoryBuilder enable(JsonWriteFeature first, JsonWriteFeature... other)
- Overrides:
enablein classTSFBuilder<JsonFactory,JsonFactoryBuilder>
-
disable
public JsonFactoryBuilder disable(JsonWriteFeature f)
- Overrides:
disablein classTSFBuilder<JsonFactory,JsonFactoryBuilder>
-
disable
public JsonFactoryBuilder disable(JsonWriteFeature first, JsonWriteFeature... other)
- Overrides:
disablein classTSFBuilder<JsonFactory,JsonFactoryBuilder>
-
configure
public JsonFactoryBuilder configure(JsonWriteFeature f, boolean state)
- Overrides:
configurein classTSFBuilder<JsonFactory,JsonFactoryBuilder>
-
characterEscapes
public JsonFactoryBuilder characterEscapes(CharacterEscapes esc)
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
public JsonFactoryBuilder rootValueSeparator(java.lang.String sep)
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
public JsonFactoryBuilder rootValueSeparator(SerializableString sep)
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
public JsonFactoryBuilder highestNonEscapedChar(int maxNonEscaped)
Method that allows specifying threshold beyond which all characters are automatically escaped (without checking possible custom escaping settings a lacharacterEscapes(com.fasterxml.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
public JsonFactoryBuilder quoteChar(char ch)
Method that allows specifying an alternate character used for quoting field names (if field name quoting has not been disabled withJsonWriteFeature.QUOTE_FIELD_NAMES) and JSON String values.Default value is double-quote (
"); typical alternative is single-quote/apostrophe (').- Parameters:
ch- Character to use for quoting field names and JSON String values.- Returns:
- This builder instance (to allow call chaining)
-
characterEscapes
public CharacterEscapes characterEscapes()
-
rootValueSeparator
public SerializableString rootValueSeparator()
-
highestNonEscapedChar
public int highestNonEscapedChar()
-
quoteChar
public char quoteChar()
-
build
public JsonFactory build()
Description copied from class:TSFBuilderMethod for constructing actualTokenStreamFactoryinstance, given configuration.- Specified by:
buildin classTSFBuilder<JsonFactory,JsonFactoryBuilder>- Returns:
TokenStreamFactorybuild based on current configuration
-
-