public final class ApplicationRunner extends Object
目前支持两种开始方式
1. 启动一个控制台应用
1.1 如果无参运行,默认将调用者实例化
2. 获得一个解释器对象 | 构造器和说明 |
|---|
ApplicationRunner() |
| 限定符和类型 | 方法和说明 |
|---|---|
static AbstractConsoleApplication |
consoleApplication()
无参运行
当调用 ApplicationRunner.consoleApplication()时,框架会实例化调用者,将调用者做为工厂注册到框架。 |
static AbstractConsoleApplication |
consoleApplication(ConsoleConfig config)
使用一个配置对象启动并获取控制台应用对象
框架中获取配置通常是使用java代码设置工厂,结合配置文件(classpath:/console.yml) |
static Interpreter |
getInterpreter()
无参获取解释器,默认将调用者实例化,将调用者做为工厂使用
|
static Interpreter |
getInterpreter(ConsoleConfig config)
根据配置生成解释器对象,此解释器可以使用字符串命令行执行所有注册到框架中的方法
|
public static AbstractConsoleApplication consoleApplication(ConsoleConfig config)
config - 一个配置对象请参考示例代码中的配置方式public static AbstractConsoleApplication consoleApplication()
ApplicationRunner.consoleApplication()时,框架会实例化调用者,将调用者做为工厂注册到框架。public static Interpreter getInterpreter()
public static Interpreter getInterpreter(ConsoleConfig config)
config - 一个配置Copyright © 2021. All rights reserved.