• 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;
    	}
    
    }
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
  • 相关阅读:
    PHP M题 20221104
    python 多线程
    vue请求后端数据和跨域问题
    uvm组件
    比postman更好用的接口管理软件——Apifox
    rust泛型
    Vue3.0 VCA语法糖 <script setup> :VCA模式
    江南爱窗帘十大品牌 | 主卧用什么窗帘最好 主卧窗帘颜色搭配有技巧
    LeetCode——面试题 02.01. 移除重复节点
    67 跳跃游戏 II
  • 原文地址:https://blog.csdn.net/xiamaocheng/article/details/126823914