Enum Class YmlFeature

java.lang.Object
java.lang.Enum<YmlFeature>
cloud.opencode.base.yml.spi.YmlFeature
All Implemented Interfaces:
Serializable, Comparable<YmlFeature>, Constable

public enum YmlFeature extends Enum<YmlFeature>
YAML Feature - Enumeration of YAML processing features YAML 特性 - YAML 处理特性的枚举

This enum defines optional features that YAML providers may support.

此枚举定义了 YAML 提供者可能支持的可选特性。

Features | 主要功能:

  • Feature flags for safe mode, block/flow style, comments, YAML 1.2, anchors, multi-doc, etc. - 安全模式、块/流风格、注释、YAML 1.2、锚点、多文档等特性标志

Usage Examples | 使用示例:

// Check if provider supports a feature
boolean hasSafeMode = provider.supports(YmlFeature.SAFE_MODE);

Security | 安全性:

  • Thread-safe: Yes (enum constants are immutable) - 线程安全: 是(枚举常量不可变)
  • Null-safe: N/A - 空值安全: 不适用
Since:
JDK 25, opencode-base-yml V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Enum Constant Details

    • ALLOW_DUPLICATE_KEYS

      public static final YmlFeature ALLOW_DUPLICATE_KEYS
      Allow duplicate keys in mappings 允许映射中的重复键
    • ALLOW_RECURSIVE_KEYS

      public static final YmlFeature ALLOW_RECURSIVE_KEYS
      Allow recursive keys 允许递归键
    • SAFE_MODE

      public static final YmlFeature SAFE_MODE
      Enable safe mode (restrict type deserialization) 启用安全模式(限制类型反序列化)
    • BLOCK_STYLE

      public static final YmlFeature BLOCK_STYLE
      Use block style for output 使用块风格输出
    • FLOW_STYLE

      public static final YmlFeature FLOW_STYLE
      Use flow style for output 使用流式风格输出
    • PRESERVE_COMMENTS

      public static final YmlFeature PRESERVE_COMMENTS
      Preserve comments during parsing 解析时保留注释
    • YAML_1_2

      public static final YmlFeature YAML_1_2
      Support YAML 1.2 specification 支持 YAML 1.2 规范
    • ANCHORS_ALIASES

      public static final YmlFeature ANCHORS_ALIASES
      Support anchors and aliases 支持锚点和别名
    • CUSTOM_TAGS

      public static final YmlFeature CUSTOM_TAGS
      Support custom tags 支持自定义标签
    • MULTI_DOCUMENT

      public static final YmlFeature MULTI_DOCUMENT
      Support multi-document parsing 支持多文档解析
    • PRETTY_PRINT

      public static final YmlFeature PRETTY_PRINT
      Pretty print output 美化打印输出
    • STRICT_TYPES

      public static final YmlFeature STRICT_TYPES
      Strict type checking 严格类型检查
  • Method Details

    • values

      public static YmlFeature[] 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 YmlFeature 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