Class YAMLFactoryBuilder

java.lang.Object
com.fasterxml.jackson.core.TSFBuilder<YAMLFactory,YAMLFactoryBuilder>
com.fasterxml.jackson.dataformat.yaml.YAMLFactoryBuilder

public class YAMLFactoryBuilder extends com.fasterxml.jackson.core.TSFBuilder<YAMLFactory,YAMLFactoryBuilder>
TSFBuilder implementation for constructing YAMLFactory instances.
  • Field Details

    • _formatGeneratorFeatures

      protected int _formatGeneratorFeatures
      Set of YAMLGenerator.Features enabled, as bitmask.
    • _formatParserFeatures

      protected int _formatParserFeatures
      Set of YAMLParser.Features enabled, as bitmask.
      Since:
      2.15
    • _quotingChecker

      protected StringQuotingChecker _quotingChecker
      Helper object used to determine whether property names, String values must be quoted or not.
      Since:
      2.12
    • _version

      protected org.yaml.snakeyaml.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.

    • _loaderOptions

      protected org.yaml.snakeyaml.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
    • _dumperOptions

      protected org.yaml.snakeyaml.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
  • Constructor Details

    • YAMLFactoryBuilder

      protected YAMLFactoryBuilder()
    • YAMLFactoryBuilder

      public YAMLFactoryBuilder(YAMLFactory base)
  • Method Details

    • enable

    • enable

      public YAMLFactoryBuilder enable(YAMLParser.Feature first, YAMLParser.Feature... other)
    • disable

    • disable

      public YAMLFactoryBuilder disable(YAMLParser.Feature first, YAMLParser.Feature... other)
    • configure

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

    • enable

    • disable

    • disable

    • configure

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

      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 - Checker to use (if non-null), or null to use the default one (see StringQuotingChecker.Default.instance())
      Returns:
      This builder instance, to allow chaining
    • yamlVersionToWrite

      public YAMLFactoryBuilder yamlVersionToWrite(org.yaml.snakeyaml.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 - YAML specification version to use for output, if not-null; null for default handling
      Returns:
      This builder instance, to allow chaining
    • loaderOptions

      public YAMLFactoryBuilder loaderOptions(org.yaml.snakeyaml.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 - the SnakeYAML configuration to use when parsing YAML
      Returns:
      This builder instance, to allow chaining
      Since:
      2.14
    • dumperOptions

      public YAMLFactoryBuilder dumperOptions(org.yaml.snakeyaml.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 - the SnakeYAML configuration to use when generating YAML
      Returns:
      This builder instance, to allow chaining
      Since:
      2.14
    • formatParserFeaturesMask

      public int formatParserFeaturesMask()
    • formatGeneratorFeaturesMask

      public int formatGeneratorFeaturesMask()
    • yamlVersionToWrite

      public org.yaml.snakeyaml.DumperOptions.Version yamlVersionToWrite()
    • stringQuotingChecker

      public StringQuotingChecker stringQuotingChecker()
    • loaderOptions

      public org.yaml.snakeyaml.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:
      the SnakeYAML configuration to use when parsing YAML
      Since:
      2.14
    • dumperOptions

      public org.yaml.snakeyaml.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:
      the SnakeYAML configuration to use when generating YAML
      Since:
      2.14
    • build

      public YAMLFactory build()
      Specified by:
      build in class com.fasterxml.jackson.core.TSFBuilder<YAMLFactory,YAMLFactoryBuilder>