Top Description Fields Constructors Methods
com.fasterxml.jackson.dataformat.yaml

public Class YAMLFactoryBuilder

extends TSFBuilder<YAMLFactory, YAMLFactoryBuilder>
Class Inheritance
Imports
com.fasterxml.jackson.core.StreamReadFeature, .TSFBuilder, org.yaml.snakeyaml.DumperOptions, .LoaderOptions, com.fasterxml.jackson.dataformat.yaml.util.StringQuotingChecker

com.fasterxml.jackson.core.TSFBuilder implementation for constructing YAMLFactory instances.

Field Summary

Modifier and TypeField and Description
protected DumperOptions
_dumperOptions

Configuration for underlying generator to follow, if specified; left as null for backwards compatibility (which means the dumper options are derived based on YAMLGenerator.Features).

protected int
_formatGeneratorFeatures

Set of YAMLGenerator.Features enabled, as bitmask.

protected int
_formatParserFeatures

Set of YAMLParser.Features enabled, as bitmask.

protected LoaderOptions
_loaderOptions

Configuration for underlying parser to follow, if specified; left as null for backwards compatibility (which means whatever default settings SnakeYAML deems best).

protected StringQuotingChecker
_quotingChecker

Helper object used to determine whether property names, String values must be quoted or not.

protected DumperOptions.Version
_version

YAML version for underlying generator to follow, if specified; left as null for backwards compatibility (which means whatever default settings SnakeYAML deems best).

Inherited from com.fasterxml.jackson.core.TSFBuilder:
_errorReportConfiguration_factoryFeatures_generatorDecorators_inputDecorator_outputDecorator_recyclerPool_streamReadConstraints_streamReadFeatures_streamWriteConstraints_streamWriteFeaturesDEFAULT_FACTORY_FEATURE_FLAGSDEFAULT_GENERATOR_FEATURE_FLAGSDEFAULT_PARSER_FEATURE_FLAGS

Constructor Summary

AccessConstructor and Description
protected
public

Method Summary

Modifier and TypeMethod and Description
public YAMLFactory
build()

Implements abstract com.fasterxml.jackson.core.TSFBuilder.build.

Method for constructing actual TokenStreamFactory instance, given configuration.

public YAMLFactoryBuilder
configure(YAMLParser.Feature f, boolean state)

public YAMLFactoryBuilder
configure(YAMLGenerator.Feature f, boolean state)

public YAMLFactoryBuilder
public YAMLFactoryBuilder
public YAMLFactoryBuilder
public YAMLFactoryBuilder
public YAMLFactoryBuilder

Returns:

This builder instance, to allow chaining
dumperOptions
(DumperOptions
the SnakeYAML configuration to use when generating YAML
dumperOptions
)

Configuration for underlying generator to follow, if specified; left as null for backwards compatibility (which means the dumper options are derived based on YAMLGenerator.Features).

public DumperOptions

Returns:

the SnakeYAML configuration to use when generating YAML
dumperOptions
()

Configuration for underlying generator to follow, if specified; left as null for backwards compatibility (which means the dumper options are derived based on YAMLGenerator.Features).

public YAMLFactoryBuilder
public YAMLFactoryBuilder
public YAMLFactoryBuilder
public YAMLFactoryBuilder
public int
public int
public YAMLFactoryBuilder

Returns:

This builder instance, to allow chaining
loaderOptions
(LoaderOptions
the SnakeYAML configuration to use when parsing YAML
loaderOptions
)

Configuration for underlying parser to follow, if specified; left as null for backwards compatibility (which means whatever default settings SnakeYAML deems best).

public LoaderOptions

Returns:

the SnakeYAML configuration to use when parsing YAML
loaderOptions
()

Configuration for underlying parser to follow, if specified; left as null for backwards compatibility (which means whatever default settings SnakeYAML deems best).

public YAMLFactoryBuilder

Returns:

This builder instance, to allow chaining
stringQuotingChecker
(StringQuotingChecker
Checker to use (if non-null), or null to use the default one (see StringQuotingChecker.Default.instance())
sqc
)

Method for specifying either custom StringQuotingChecker to use instead of default one, or, that default one (see StringQuotingChecker.Default.instance()) is to be used (when passing null

public StringQuotingChecker
public YAMLFactoryBuilder

Returns:

This builder instance, to allow chaining
yamlVersionToWrite
(DumperOptions.Version
YAML specification version to use for output, if not-null; null for default handling
v
)

Method for specifying YAML version for generator to use (to produce compliant output); if null passed, will let SnakeYAML use its default settings.

public DumperOptions.Version
Inherited from com.fasterxml.jackson.core.TSFBuilder:
_copy_legacyDisable_legacyDisable_legacyEnable_legacyEnable_thisaddDecoratorconfigureconfigureconfigureconfigureconfiguredisabledisabledisabledisabledisabledisabledisabledisabledisableenableenableenableenableenableenableenableenableenableerrorReportConfigurationfactoryFeaturesMaskinputDecoratorinputDecoratoroutputDecoratoroutputDecoratorrecyclerPoolrecyclerPoolstreamReadConstraintsstreamReadFeaturesstreamWriteConstraintsstreamWriteFeatures

Field Detail

_dumperOptionsback to summary
protected DumperOptions _dumperOptions

Configuration for underlying generator to follow, if specified; left as null for backwards compatibility (which means the dumper options are derived based on YAMLGenerator.Features).

These YAMLGenerator.Features are ignored if you provide your own DumperOptions:

  • YAMLGenerator.Feature.ALLOW_LONG_KEYS
  • YAMLGenerator.Feature.CANONICAL_OUTPUT
  • YAMLGenerator.Feature.INDENT_ARRAYS
  • YAMLGenerator.Feature.INDENT_ARRAYS_WITH_INDICATOR
  • YAMLGenerator.Feature.SPLIT_LINES
  • YAMLGenerator.Feature.USE_PLATFORM_LINE_BREAKS

Since
2.14
_formatGeneratorFeaturesback to summary
protected int _formatGeneratorFeatures

Set of YAMLGenerator.Features enabled, as bitmask.

_formatParserFeaturesback to summary
protected int _formatParserFeatures

Set of YAMLParser.Features enabled, as bitmask.

Since
2.15
_loaderOptionsback to summary
protected LoaderOptions _loaderOptions

Configuration for underlying parser to follow, if specified; left as null for backwards compatibility (which means whatever default settings SnakeYAML deems best).

If you need to support parsing YAML files that are larger than 3Mb, it is recommended that you provide a LoaderOptions instance where you set the Codepoint Limit to a larger value than its 3Mb default.

Since
2.14
_quotingCheckerback to summary
protected StringQuotingChecker _quotingChecker

Helper object used to determine whether property names, String values must be quoted or not.

Since
2.12
_versionback to summary
protected DumperOptions.Version _version

YAML version for underlying generator to follow, if specified; left as null for backwards compatibility (which means whatever default settings SnakeYAML deems best).

Ignored if you provide your own DumperOptions.

Constructor Detail

YAMLFactoryBuilderback to summary
protected YAMLFactoryBuilder()
YAMLFactoryBuilderback to summary
public YAMLFactoryBuilder(YAMLFactory base)

Method Detail

buildback to summary
public YAMLFactory build()

Implements abstract com.fasterxml.jackson.core.TSFBuilder.build.

Doc from com.fasterxml.jackson.core.TSFBuilder.build.

Method for constructing actual TokenStreamFactory instance, given configuration.

Returns:YAMLFactory

TokenStreamFactory build based on current configuration

Annotations
@Override
configureback to summary
public YAMLFactoryBuilder configure(YAMLParser.Feature f, boolean state)
configureback to summary
public YAMLFactoryBuilder configure(YAMLGenerator.Feature f, boolean state)
disableback to summary
public YAMLFactoryBuilder disable(YAMLParser.Feature f)
disableback to summary
public YAMLFactoryBuilder disable(YAMLParser.Feature first, YAMLParser.Feature... other)
disableback to summary
public YAMLFactoryBuilder disable(YAMLGenerator.Feature f)
disableback to summary
public YAMLFactoryBuilder disable(YAMLGenerator.Feature first, YAMLGenerator.Feature... other)
dumperOptionsback to summary
public YAMLFactoryBuilder dumperOptions(DumperOptions dumperOptions)

Configuration for underlying generator to follow, if specified; left as null for backwards compatibility (which means the dumper options are derived based on YAMLGenerator.Features).

These YAMLGenerator.Features are ignored if you provide your own DumperOptions:

  • YAMLGenerator.Feature.ALLOW_LONG_KEYS
  • YAMLGenerator.Feature.CANONICAL_OUTPUT
  • YAMLGenerator.Feature.INDENT_ARRAYS
  • YAMLGenerator.Feature.INDENT_ARRAYS_WITH_INDICATOR
  • YAMLGenerator.Feature.SPLIT_LINES
  • YAMLGenerator.Feature.USE_PLATFORM_LINE_BREAKS

Parameters
dumperOptions:DumperOptions

the SnakeYAML configuration to use when generating YAML

Returns:YAMLFactoryBuilder

This builder instance, to allow chaining

Since
2.14
dumperOptionsback to summary
public DumperOptions dumperOptions()

Configuration for underlying generator to follow, if specified; left as null for backwards compatibility (which means the dumper options are derived based on YAMLGenerator.Features).

These YAMLGenerator.Features are ignored if you provide your own DumperOptions:

  • YAMLGenerator.Feature.ALLOW_LONG_KEYS
  • YAMLGenerator.Feature.CANONICAL_OUTPUT
  • YAMLGenerator.Feature.INDENT_ARRAYS
  • YAMLGenerator.Feature.INDENT_ARRAYS_WITH_INDICATOR
  • YAMLGenerator.Feature.SPLIT_LINES
  • YAMLGenerator.Feature.USE_PLATFORM_LINE_BREAKS

Returns:DumperOptions

the SnakeYAML configuration to use when generating YAML

Since
2.14
enableback to summary
public YAMLFactoryBuilder enable(YAMLParser.Feature f)
enableback to summary
public YAMLFactoryBuilder enable(YAMLParser.Feature first, YAMLParser.Feature... other)
enableback to summary
public YAMLFactoryBuilder enable(YAMLGenerator.Feature f)
enableback to summary
public YAMLFactoryBuilder enable(YAMLGenerator.Feature first, YAMLGenerator.Feature... other)
formatGeneratorFeaturesMaskback to summary
public int formatGeneratorFeaturesMask()
formatParserFeaturesMaskback to summary
public int formatParserFeaturesMask()
loaderOptionsback to summary
public YAMLFactoryBuilder loaderOptions(LoaderOptions loaderOptions)

Configuration for underlying parser to follow, if specified; left as null for backwards compatibility (which means whatever default settings SnakeYAML deems best).

If you need to support parsing YAML files that are larger than 3Mb, it is recommended that you provide a LoaderOptions instance where you set the Codepoint Limit to a larger value than its 3Mb default.

Parameters
loaderOptions:LoaderOptions

the SnakeYAML configuration to use when parsing YAML

Returns:YAMLFactoryBuilder

This builder instance, to allow chaining

Since
2.14
loaderOptionsback to summary
public LoaderOptions loaderOptions()

Configuration for underlying parser to follow, if specified; left as null for backwards compatibility (which means whatever default settings SnakeYAML deems best).

If you need to support parsing YAML files that are larger than 3Mb, it is recommended that you provide a LoaderOptions instance where you set the Codepoint Limit to a larger value than its 3Mb default.

Returns:LoaderOptions

the SnakeYAML configuration to use when parsing YAML

Since
2.14
stringQuotingCheckerback to summary
public YAMLFactoryBuilder stringQuotingChecker(StringQuotingChecker sqc)

Method for specifying either custom StringQuotingChecker to use instead of default one, or, that default one (see StringQuotingChecker.Default.instance()) is to be used (when passing null

Parameters
sqc:StringQuotingChecker

Checker to use (if non-null), or null to use the default one (see StringQuotingChecker.Default.instance())

Returns:YAMLFactoryBuilder

This builder instance, to allow chaining

stringQuotingCheckerback to summary
public StringQuotingChecker stringQuotingChecker()
yamlVersionToWriteback to summary
public YAMLFactoryBuilder yamlVersionToWrite(DumperOptions.Version v)

Method for specifying YAML version for generator to use (to produce compliant output); if null passed, will let SnakeYAML use its default settings.

Parameters
v:DumperOptions.Version

YAML specification version to use for output, if not-null; null for default handling

Returns:YAMLFactoryBuilder

This builder instance, to allow chaining

yamlVersionToWriteback to summary
public DumperOptions.Version yamlVersionToWrite()