1.美图

2.概述
SpringBoot 的配置文件内置支持 properties、xml、yml、yaml
几种格式,其中 properties
和xml
对应的Loader
类为 PropertiesPropertySourceLoader
,yml
和yaml
对应的Loader类为 YamlPropertySourceLoader
。
观察这2个类可以发现,都实现自接口 PropertySourceLoader
。所以我们要新增支持别的格式的配置文件,就可以通过实现接口 PropertySourceLoader
来实现了。
2.1 源码
@Target