接口 CommandLineRunner
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