Class SerdeYamlConfiguration.ReadFeatures

java.lang.Object
io.micronaut.serde.yaml.SerdeYamlConfiguration.ReadFeatures
Enclosing class:
SerdeYamlConfiguration

@ConfigurationProperties("read-features") public static final class SerdeYamlConfiguration.ReadFeatures extends Object
Controls YAML deserialization behavior.
Since:
3.2.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The default maximum number of code points a single YAML input may contain: 3 MiB.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the maximum number of code points a single YAML input may contain.
    boolean
    Returns whether YAML boolean-like words such as yes, no, on, and off should be parsed as strings.
    boolean
    Returns whether an empty plain YAML scalar should be parsed as null.
    void
    setBooleanAsStrings(boolean booleanAsStrings)
    Sets whether YAML boolean-like words should be parsed as strings.
    void
    setCodePointLimit(int codePointLimit)
    Sets the maximum number of code points a single YAML input may contain.
    void
    setEmptyStringAsNull(boolean emptyStringAsNull)
    Sets whether an empty plain YAML scalar should be parsed as null.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_CODE_POINT_LIMIT

      public static final int DEFAULT_CODE_POINT_LIMIT
      The default maximum number of code points a single YAML input may contain: 3 MiB.
      See Also:
  • Constructor Details

    • ReadFeatures

      public ReadFeatures()
  • Method Details

    • isBooleanAsStrings

      public boolean isBooleanAsStrings()
      Returns whether YAML boolean-like words such as yes, no, on, and off should be parsed as strings. The canonical true and false values are still parsed as booleans. This feature is enabled by default to match Jackson 3 behavior.
      Returns:
      Whether boolean-like words should be parsed as strings
    • setBooleanAsStrings

      public void setBooleanAsStrings(boolean booleanAsStrings)
      Sets whether YAML boolean-like words should be parsed as strings.
      Parameters:
      booleanAsStrings - Whether boolean-like words should be parsed as strings
    • isEmptyStringAsNull

      public boolean isEmptyStringAsNull()
      Returns whether an empty plain YAML scalar should be parsed as null. This feature is enabled by default.
      Returns:
      Whether an empty plain scalar should be parsed as null
    • setEmptyStringAsNull

      public void setEmptyStringAsNull(boolean emptyStringAsNull)
      Sets whether an empty plain YAML scalar should be parsed as null.
      Parameters:
      emptyStringAsNull - Whether an empty plain scalar should be parsed as null
    • getCodePointLimit

      public int getCodePointLimit()
      Returns the maximum number of code points a single YAML input may contain. Larger input is rejected before it is parsed, which bounds the memory an untrusted document can claim. Default value (3145728).
      Returns:
      The code point limit
    • setCodePointLimit

      public void setCodePointLimit(int codePointLimit)
      Sets the maximum number of code points a single YAML input may contain.
      Parameters:
      codePointLimit - The code point limit, greater than zero