java.lang.Object
api.linlang.runtime.Lin
Linlang 运行时发现与插件级门面的统一入口。
通常使用 setup(Object, LinOptions) 完成发现、插件上下文注入、选项应用和重载。
-
方法概要
修饰符和类型方法说明static Linlangconfigure(Object platformContext, LinOptions opts) 应用LinOptions,但不主动重载运行时。static Linlangconfigure(Object platformContext, String requiredApiVersion, LinOptions opts) 校验依赖版本并配置插件门面,不主动重载。static Linlangfind()获取已注册的运行时实现;若不存在则抛出IllegalStateException。static Linlang按插件声明的 API 版本发现并检查共享运行时。static Linlang发现运行时、创建插件级门面、注入平台上下文并重载。static Linlang检查插件声明的 API 版本,通过后创建门面并重载。static Linlangsetup(Object platformContext, LinOptions linOptions) 发现运行时、创建插件级门面、应用选项并重载。static Linlangsetup(Object platformContext, String requiredApiVersion, LinOptions linOptions) 在创建门面前校验依赖版本,然后应用选项并重载。static Linlangsetup(Object platformContext, String requiredApiVersion, Function<Linlang, LinOptions> optionsBuilder) 在创建门面和调用选项回调前校验依赖版本。static Linlangsetup(Object platformContext, Function<Linlang, LinOptions> optionsBuilder) 发现运行时,并通过回调在插件级门面可用后创建和应用选项。
-
方法详细资料
-
find
获取已注册的运行时实现;若不存在则抛出IllegalStateException。- 返回:
- 非空的运行时实例
- 抛出:
IllegalStateException- 未安装兼容的 LinlangRuntime 时
-
find
按插件声明的 API 版本发现并检查共享运行时。- 参数:
requiredApiVersion- 插件编译时依赖的版本,应由插件自身保存- 返回:
- 通过兼容性检查的运行时
- 抛出:
IllegalStateException- 运行时缺失、版本不兼容或无法识别
-
init
发现运行时、创建插件级门面、注入平台上下文并重载。- 参数:
platformContext- 运行环境上下文,在主类中传递this即可- 返回:
- 已就绪但未应用个性化设置的插件级门面
-
init
检查插件声明的 API 版本,通过后创建门面并重载。- 参数:
platformContext- 插件上下文requiredApiVersion- 插件自身保存的编译依赖版本- 返回:
- 已就绪的插件门面
-
setup
发现运行时、创建插件级门面、应用选项并重载。- 参数:
platformContext- 运行环境上下文,在主类中传递自身即可linOptions- 琳琅个性化设置LinOptions实例- 返回:
- 已应用选项并完成重载的插件级门面
-
setup
public static Linlang setup(Object platformContext, String requiredApiVersion, LinOptions linOptions) 在创建门面前校验依赖版本,然后应用选项并重载。- 参数:
platformContext- 插件上下文requiredApiVersion- 插件自身保存的编译依赖版本linOptions- 初始化选项- 返回:
- 已就绪的插件门面
-
setup
发现运行时,并通过回调在插件级门面可用后创建和应用选项。- 参数:
platformContext- 运行环境上下文,在主类中传递自身即可optionsBuilder- 函数式接口,回调:接受Linlang,返回要应用的LinOptions,可为null- 返回:
- 已应用选项并完成重载的插件级门面
-
setup
public static Linlang setup(Object platformContext, String requiredApiVersion, Function<Linlang, LinOptions> optionsBuilder) 在创建门面和调用选项回调前校验依赖版本。- 参数:
platformContext- 插件上下文requiredApiVersion- 插件自身保存的编译依赖版本optionsBuilder- 选项回调- 返回:
- 已就绪的插件门面
-
configure
应用LinOptions,但不主动重载运行时。适合需要由调用方决定重载时机的两阶段装配。
- 参数:
platformContext- 宿主上下文opts- 装配选项,可为null- 返回:
- 已应用选项但未重载的插件级门面
-
configure
校验依赖版本并配置插件门面,不主动重载。- 参数:
platformContext- 插件上下文requiredApiVersion- 插件自身保存的编译依赖版本opts- 初始化选项- 返回:
- 已配置的插件门面
-