类 ConfigurationPropertySources

    • 方法详细资料

      • attach

        public static void attach​(org.springframework.core.env.Environment environment)
        Attach a ConfigurationPropertySource support to the specified Environment. Adapts each PropertySource managed by the environment to a ConfigurationPropertySource and allows classic PropertySourcesPropertyResolver calls to resolve using configuration property names.

        The attached resolver will dynamically track any additions or removals from the underlying Environment property sources.

        参数:
        environment - the source environment (must be an instance of ConfigurableEnvironment)
        另请参阅:
        get(Environment)
      • from

        public static Iterable<ConfigurationPropertySourcefrom​(Iterable<org.springframework.core.env.PropertySource<?>> sources)
        Return Iterable containing new ConfigurationPropertySource instances adapted from the given Spring PropertySources.

        This method will flatten any nested property sources and will filter all stub property sources. Updates to the underlying source, identified by changes in the sources returned by its iterator, will be automatically tracked. The underlying source should be thread safe, for example a MutablePropertySources

        参数:
        sources - the Spring property sources to adapt
        返回:
        an Iterable containing newly adapted SpringConfigurationPropertySource instances