Class YAMLFactory

java.lang.Object
com.fasterxml.jackson.core.TokenStreamFactory
com.fasterxml.jackson.core.JsonFactory
com.fasterxml.jackson.dataformat.yaml.YAMLFactory
All Implemented Interfaces:
com.fasterxml.jackson.core.Versioned, Serializable

public class YAMLFactory extends com.fasterxml.jackson.core.JsonFactory
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • FORMAT_NAME_YAML

      public static final String FORMAT_NAME_YAML
      Name used to identify YAML format. (and returned by getFormatName()
      See Also:
    • DEFAULT_YAML_PARSER_FEATURE_FLAGS

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

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

      private static final byte UTF8_BOM_1
      See Also:
    • UTF8_BOM_2

      private static final byte UTF8_BOM_2
      See Also:
    • UTF8_BOM_3

      private static final byte UTF8_BOM_3
      See Also:
    • _yamlGeneratorFeatures

      protected int _yamlGeneratorFeatures
    • _yamlParserFeatures

      protected int _yamlParserFeatures
    • _version

      protected final org.yaml.snakeyaml.DumperOptions.Version _version
      YAML version for underlying generator to follow, if specified.
      Since:
      2.12
    • _quotingChecker

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

      protected final 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 final 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

    • YAMLFactory

      public YAMLFactory()
      Default constructor used to create factory instances. Creation of a factory instance is a light-weight operation, but it is still a good idea to reuse limited number of factory instances (and quite often just a single instance): factories are used as context for storing some reused processing objects (such as symbol tables parsers use) and this reuse only works within context of a single factory instance.
    • YAMLFactory

      public YAMLFactory(com.fasterxml.jackson.core.ObjectCodec oc)
    • YAMLFactory

      public YAMLFactory(YAMLFactory src, com.fasterxml.jackson.core.ObjectCodec oc)
      Since:
      2.2
    • YAMLFactory

      protected YAMLFactory(YAMLFactoryBuilder b)
      Constructors used by YAMLFactoryBuilder for instantiation.
      Since:
      3.0
  • Method Details

    • rebuild

      public YAMLFactoryBuilder rebuild()
      Overrides:
      rebuild in class com.fasterxml.jackson.core.JsonFactory
    • builder

      public static YAMLFactoryBuilder builder()
      Main factory method to use for constructing YAMLFactory instances with different configuration.
    • copy

      public YAMLFactory copy()
      Overrides:
      copy in class com.fasterxml.jackson.core.JsonFactory
    • readResolve

      protected Object readResolve()
      Method that we need to override to actually make restoration go through constructors etc. Also: must be overridden by sub-classes as well.
      Overrides:
      readResolve in class com.fasterxml.jackson.core.JsonFactory
    • version

      public com.fasterxml.jackson.core.Version version()
      Specified by:
      version in interface com.fasterxml.jackson.core.Versioned
      Overrides:
      version in class com.fasterxml.jackson.core.JsonFactory
    • canUseCharArrays

      public boolean canUseCharArrays()
      Overrides:
      canUseCharArrays in class com.fasterxml.jackson.core.JsonFactory
    • getFormatReadFeatureType

      public Class<YAMLParser.Feature> getFormatReadFeatureType()
      Overrides:
      getFormatReadFeatureType in class com.fasterxml.jackson.core.JsonFactory
    • getFormatWriteFeatureType

      public Class<YAMLGenerator.Feature> getFormatWriteFeatureType()
      Overrides:
      getFormatWriteFeatureType in class com.fasterxml.jackson.core.JsonFactory
    • getFormatName

      public String getFormatName()
      Overrides:
      getFormatName in class com.fasterxml.jackson.core.JsonFactory
    • hasFormat

      public com.fasterxml.jackson.core.format.MatchStrength hasFormat(com.fasterxml.jackson.core.format.InputAccessor acc) throws IOException
      Sub-classes need to override this method
      Overrides:
      hasFormat in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • configure

      public final YAMLFactory configure(YAMLGenerator.Feature f, boolean state)
      Method for enabling or disabling specified generator feature (check YAMLGenerator.Feature for list of features)
    • enable

      Method for enabling specified generator features (check YAMLGenerator.Feature for list of features)
    • disable

      public YAMLFactory disable(YAMLGenerator.Feature f)
      Method for disabling specified generator feature (check YAMLGenerator.Feature for list of features)
    • isEnabled

      public final boolean isEnabled(YAMLGenerator.Feature f)
      Check whether specified generator feature is enabled.
    • getFormatGeneratorFeatures

      public int getFormatGeneratorFeatures()
      Overrides:
      getFormatGeneratorFeatures in class com.fasterxml.jackson.core.JsonFactory
    • configure

      public final YAMLFactory configure(YAMLParser.Feature f, boolean state)
      Method for enabling or disabling specified parser feature (check YAMLParser.Feature for list of features)
    • enable

      public YAMLFactory enable(YAMLParser.Feature f)
      Method for enabling specified parser feature (check YAMLParser.Feature for list of features)
    • disable

      public YAMLFactory disable(YAMLParser.Feature f)
      Method for disabling specified parser features (check YAMLParser.Feature for list of features)
    • isEnabled

      public final boolean isEnabled(YAMLParser.Feature f)
      Checked whether specified parser feature is enabled.
    • getFormatParserFeatures

      public int getFormatParserFeatures()
      Overrides:
      getFormatParserFeatures in class com.fasterxml.jackson.core.JsonFactory
    • createParser

      public YAMLParser createParser(String content) throws IOException
      Overrides:
      createParser in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • createParser

      public YAMLParser createParser(File f) throws IOException
      Overrides:
      createParser in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • createParser

      public YAMLParser createParser(URL url) throws IOException
      Overrides:
      createParser in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • createParser

      public YAMLParser createParser(InputStream in) throws IOException
      Overrides:
      createParser in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • createParser

      public YAMLParser createParser(Reader r) throws IOException
      Overrides:
      createParser in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • createParser

      public YAMLParser createParser(char[] data) throws IOException
      Overrides:
      createParser in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • createParser

      public YAMLParser createParser(char[] data, int offset, int len) throws IOException
      Overrides:
      createParser in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • createParser

      public YAMLParser createParser(byte[] data) throws IOException
      Overrides:
      createParser in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • createParser

      public YAMLParser createParser(byte[] data, int offset, int len) throws IOException
      Overrides:
      createParser in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • createGenerator

      public YAMLGenerator createGenerator(OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc) throws IOException
      Overrides:
      createGenerator in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • createGenerator

      public YAMLGenerator createGenerator(OutputStream out) throws IOException
      Overrides:
      createGenerator in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • createGenerator

      public YAMLGenerator createGenerator(Writer out) throws IOException
      Overrides:
      createGenerator in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • createGenerator

      public com.fasterxml.jackson.core.JsonGenerator createGenerator(File f, com.fasterxml.jackson.core.JsonEncoding enc) throws IOException
      Overrides:
      createGenerator in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • _createParser

      protected YAMLParser _createParser(InputStream in, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
      Overrides:
      _createParser in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • _createParser

      protected YAMLParser _createParser(Reader r, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
      Overrides:
      _createParser in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • _createParser

      protected YAMLParser _createParser(char[] data, int offset, int len, com.fasterxml.jackson.core.io.IOContext ctxt, boolean recyclable) throws IOException
      Overrides:
      _createParser in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • _createParser

      protected YAMLParser _createParser(byte[] data, int offset, int len, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
      Overrides:
      _createParser in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • _createGenerator

      protected YAMLGenerator _createGenerator(Writer out, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
      Overrides:
      _createGenerator in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • _createUTF8Generator

      protected YAMLGenerator _createUTF8Generator(OutputStream out, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
      Overrides:
      _createUTF8Generator in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • _createWriter

      protected Writer _createWriter(OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
      Overrides:
      _createWriter in class com.fasterxml.jackson.core.JsonFactory
      Throws:
      IOException
    • _createReader

      protected Reader _createReader(InputStream in, com.fasterxml.jackson.core.JsonEncoding enc, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
      Throws:
      IOException
    • _createReader

      protected Reader _createReader(byte[] data, int offset, int len, com.fasterxml.jackson.core.JsonEncoding enc, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
      Throws:
      IOException