Class NativeImageConfigGenerator.Builder
java.lang.Object
cloud.opencode.base.classloader.graalvm.NativeImageConfigGenerator.Builder
- Enclosing class:
NativeImageConfigGenerator
Builder for NativeImageConfigGenerator
NativeImageConfigGenerator 的构建器
Security | 安全性:
- Thread-safe: No (intended for single-thread construction) - 线程安全: 否(设计为单线程构建)
- Since:
- JDK 25, opencode-base-classloader V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionaddPackage(String packageName) Add a package to scan for reflection configuration 添加要扫描反射配置的包addResourcePattern(String pattern) Add a resource pattern for resource-config.json 添加资源模式到 resource-config.jsonbuild()Build the generator without executing 构建生成器但不执行classLoader(ClassLoader classLoader) Set the class loader used for scanning 设置用于扫描的类加载器voidgenerate()Build and execute the generation 构建并执行生成Set the output directory for generated files 设置生成文件的输出目录
-
Method Details
-
addPackage
Add a package to scan for reflection configuration 添加要扫描反射配置的包- Parameters:
packageName- package name | 包名- Returns:
- this builder | 此构建器
- Throws:
NullPointerException- if packageName is null | 如果包名为 null 抛出异常
-
addResourcePattern
Add a resource pattern for resource-config.json 添加资源模式到 resource-config.json- Parameters:
pattern- resource glob pattern | 资源匹配模式- Returns:
- this builder | 此构建器
- Throws:
NullPointerException- if pattern is null | 如果模式为 null 抛出异常
-
outputDir
Set the output directory for generated files 设置生成文件的输出目录- Parameters:
outputDir- output directory path | 输出目录路径- Returns:
- this builder | 此构建器
- Throws:
NullPointerException- if outputDir is null | 如果输出目录为 null 抛出异常
-
classLoader
Set the class loader used for scanning 设置用于扫描的类加载器- Parameters:
classLoader- class loader | 类加载器- Returns:
- this builder | 此构建器
-
generate
Build and execute the generation 构建并执行生成- Throws:
IOException- if an I/O error occurs | 如果发生 I/O 错误
-
build
Build the generator without executing 构建生成器但不执行- Returns:
- configured generator | 已配置的生成器
-