java.lang.Object
api.linlang.runtime.Lin
入口门面,其发现并缓存运行时的
Linlang 实现,是唯一使用入口。-
方法概要
修饰符和类型方法说明static Linlangconfigure(Object platformContext, LinOptions opts) 接受LinOptions实例,对琳琅服务进行个性化设置static Linlangfind()获取已注册的运行时实现;若不存在则抛出IllegalStateException。static Linlang装载:发现 → 注入环境上下文 →reload()static Linlangsetup(Object platformContext, LinOptions linOptions) 装载:发现 -> 注入环境上下文 -> 通过回调读取个性化选项LinOptions-> 应用并reload()static Linlangsetup(Object platformContext, Function<Linlang, LinOptions> optionsBuilder) 装载:发现 -> 注入环境上下文 -> 通过回调读取个性化选项LinOptions-> 应用并reload()
-
方法详细资料
-
find
获取已注册的运行时实现;若不存在则抛出IllegalStateException。- 返回:
- 非空的运行时实例
- 抛出:
IllegalStateException- 未安装兼容的 LinlangRuntime 时
-
init
装载:发现 → 注入环境上下文 →reload()用于分步骤初始化琳琅服务
- 参数:
platformContext- 运行环境上下文,在主类中传递this即可- 返回:
- 已就绪的运行时实例,但未进行任何个性化设置
-
setup
- 参数:
platformContext- 运行环境上下文,在主类中传递自身即可linOptions- 琳琅个性化设置LinOptions实例- 返回:
- 已就绪的运行时实例,且进行了个性化设置
-
setup
装载:发现 -> 注入环境上下文 -> 通过回调读取个性化选项LinOptions-> 应用并reload()用于一站式初始化琳琅服务,且配置由琳琅托管,需要先绑定配置/语言再决定前缀与语言
在 初始化 页面中,您可以看到使用示例
- 参数:
platformContext- 运行环境上下文,在主类中传递自身即可optionsBuilder- 函数式接口,回调:接受Linlang,返回要应用的LinOptions,可为null- 返回:
- 已就绪的运行时实例,且进行了个性化设置
-
configure
接受LinOptions实例,对琳琅服务进行个性化设置适合两阶段装配:先
Linlang lin = Lin.init()获得琳琅服务,然后使用此方法完成自定义初始化/p>- 参数:
platformContext- 宿主上下文opts- 装配选项,可为null- 返回:
- 运行时实例(已应用选项但未重载)
-