1 Star 0 Fork 156

小风 / Spring-Analysis

forked from huifer / Code-Analysis 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Spring-StandardEnvironment.md 687 Bytes
一键复制 编辑 原始数据 按行查看 历史
huifer 提交于 2020-11-09 10:08 . :fire:doc: env + PropertyResolver

Spring StandardEnvironment

  • 类全路径: org.springframework.core.env.StandardEnvironment

  • 类图 StandardEnvironment

customizePropertySources

  • 处理属性源
    1. 获取 system property 放入资源对象
    2. 获取 system environment 放入资源对象

	@Override
	protected void customizePropertySources(MutablePropertySources propertySources) {
		propertySources.addLast(
				new PropertiesPropertySource(SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME, getSystemProperties()));
		propertySources.addLast(
				new SystemEnvironmentPropertySource(SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, getSystemEnvironment()));
	}
Java
1
https://gitee.com/jsfen/spring-analysis.git
git@gitee.com:jsfen/spring-analysis.git
jsfen
spring-analysis
Spring-Analysis
master

搜索帮助