Class YmlIncludeResolver.Builder

java.lang.Object
cloud.opencode.base.yml.include.YmlIncludeResolver.Builder
Enclosing class:
YmlIncludeResolver

public static final class YmlIncludeResolver.Builder extends Object
Builder for YmlIncludeResolver - Configures include resolution behavior YmlIncludeResolver 构建器 - 配置包含解析行为
Since:
JDK 25, opencode-base-yml V1.0.3
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Method Details

    • maxDepth

      public YmlIncludeResolver.Builder maxDepth(int maxDepth)
      Sets the maximum include depth. 设置最大包含深度。
      Parameters:
      maxDepth - the maximum depth (must be positive) | 最大深度(必须为正数)
      Returns:
      this builder | 此构建器
      Throws:
      IllegalArgumentException - if maxDepth is not positive | 当 maxDepth 不为正数时
    • allowedExtensions

      public YmlIncludeResolver.Builder allowedExtensions(Set<String> extensions)
      Sets the allowed file extensions for included files. 设置包含文件允许的文件扩展名。
      Parameters:
      extensions - the allowed extensions (e.g. ".yml", ".yaml") | 允许的扩展名
      Returns:
      this builder | 此构建器
      Throws:
      NullPointerException - if extensions is null | 当 extensions 为 null 时
      IllegalArgumentException - if extensions is empty | 当 extensions 为空时
    • basePath

      public YmlIncludeResolver.Builder basePath(Path basePath)
      Sets the base path for resolving included files. 设置解析包含文件的基础路径。

      All included file paths must resolve within this directory. If not set, the parent directory of the loaded file is used.

      所有包含的文件路径必须在此目录内解析。 如果未设置,则使用加载文件的父目录。

      Parameters:
      basePath - the base directory | 基础目录
      Returns:
      this builder | 此构建器
    • build

      public YmlIncludeResolver build()
      Builds the YmlIncludeResolver. 构建 YmlIncludeResolver。
      Returns:
      the configured resolver | 配置好的解析器