Springboot 开发env

env的是:配置的树的属性源:
ConfigTreePropertySource: 配置树的性的属性源文件:
EnvironmentPostProcessor:环境配置后置处理器
EnvironmentPostProcessorApplicationListener: 处理环境的ApplcationListerner:
EnvironmentPostProcessorsFactory:环境处理工厂:
OriginTrackedMapPropertySource:原先的map属性源。
OriginTrackedPropertiesLoader:原先属性的加载器:
OriginTrackedYamlLoader:原先的TrackerYaml加载器:
PropertiesPropertySourceLoader:xml属性文件源文件加载器:
PropertySourceLoader:属性源文件加载器:
PropertySourceRuntimeHints: 属性源文件润赢得点击实现了RuntimeHintsRegistrar:
RandomValuePropertySource:随机数值源文件:
RandomValuePropertySourceEnvironmentPostProcessor:随机数值源文件处理器。
ReflectionEnvironmentPostProcessorsFactory:反射环境的后置处理器工厂:SpringApplicationJsonEnvironmentPostProcessor:Spring 应用程序JSON环境配置处理器:
其中yaml属性文件:处理器:

public class YamlPropertySourceLoader implements PropertySourceLoader {

	@Override
	public String[] getFileExtensions() {
		return new String[] { "yml", "yaml" };
	}

	@Override
	public List<PropertySource<?>> load(String name, Resource resource) throws IOException {
		if (!ClassUtils.isPresent("org.yaml.snakeyaml.Yaml", getClass().getClassLoader())) {
			throw new IllegalStateException(
					"Attempted to load " + name + " but snakeyaml was not found on the classpath");
		}
		List<Map<String, Object>> loaded = new OriginTrackedYamlLoader(resource).load();
		if (loaded.isEmpty()) {
			return Collections.emptyList();
		}
		List<PropertySource<?>> propertySources = new ArrayList<>(loaded.size());
		for (int i = 0; i < loaded.size(); i++) {
			String documentNumber = (loaded.size() != 1) ? " (document #" + i + ")" : "";
			propertySources.add(new OriginTrackedMapPropertySource(name + documentNumber,
					Collections.unmodifiableMap(loaded.get(i)), true));
		}
		return propertySources;
	}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

执于代码

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值