DEMO
https://blog.csdn.net/xiejiefeng333/article/details/84106684
EnvironmentPostProcessor接口官网说明
官方文档如下
Allows for customization of the application's {@link Environment} prior to the application context being refreshed.
允许定制应用的上下文的应用环境优于应用的上下文之前被刷新。
EnvironmentPostProcessor implementations have to be registered in
META-INF/spring.factories, using the fully qualified name of this class as the key.
使用方式是实现类要在META-INF/spring.factories
文件中去注册全类名。
EnvironmentPostProcessor processors are encouraged to detect whether Spring's
org.springframework.core.Ordered
Ordered interface has been implemented or if the@org.springframework.core.annotation.Order
Order annotation is present and to sort instances accordingly if so prior to invocation.
鼓励EnvironmentPostProcessor处理器检测Org.springframework.core.Ordered
注解,这样相应的实例也会按照@Order注解的顺序去被调用。