接口 CommandLineRunner
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
@FunctionalInterface public interface CommandLineRunner
Interface used to indicate that a bean should run when it is contained within aSpringApplication
. MultipleCommandLineRunner
beans can be defined within the same application context and can be ordered using theOrdered
interface or@Order
annotation.If you need access to
ApplicationArguments
instead of the raw String array consider usingApplicationRunner
.- 另请参阅:
ApplicationRunner