Enum Class YAMLReadFeature

java.lang.Object
java.lang.Enum<YAMLReadFeature>
tools.jackson.dataformat.yaml.YAMLReadFeature
All Implemented Interfaces:
Serializable, Comparable<YAMLReadFeature>, Constable, tools.jackson.core.FormatFeature, tools.jackson.core.util.JacksonFeature

public enum YAMLReadFeature extends Enum<YAMLReadFeature> implements tools.jackson.core.FormatFeature
Enumeration that defines all togglable features for YAML parsers.

NOTE: in Jackson 2.x this was named YAMLParser.Feature.

  • Enum Constant Details

    • EMPTY_DOCUMENT_AS_EMPTY_OBJECT

      public static final YAMLReadFeature EMPTY_DOCUMENT_AS_EMPTY_OBJECT
      Feature that determines whether empty YAML documents (documents with only comments or whitespace, or completely empty) should be exposed as empty Object (START_OBJECT/END_OBJECT token pair) instead of causing "No content to map" error.

      This is useful for example for deserializing to POJOs with default values, where an empty configuration file should create an object with all default values rather than failing.

      Feature is disabled by default for backwards-compatibility.

    • EMPTY_STRING_AS_NULL

      public static final YAMLReadFeature EMPTY_STRING_AS_NULL
      Feature that determines whether an empty String will be parsed as null. Logic is part of YAML 1.1 Null Language-Independent Type.

      Feature is enabled by default for backwards-compatibility reasons.

  • Method Details

    • values

      public static YAMLReadFeature[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static YAMLReadFeature valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • collectDefaults

      public static int collectDefaults()
    • enabledByDefault

      public boolean enabledByDefault()
      Specified by:
      enabledByDefault in interface tools.jackson.core.util.JacksonFeature
    • enabledIn

      public boolean enabledIn(int flags)
      Specified by:
      enabledIn in interface tools.jackson.core.util.JacksonFeature
    • getMask

      public int getMask()
      Specified by:
      getMask in interface tools.jackson.core.util.JacksonFeature