/** * Add the properties from the underlying map to the environment using the specified * property source type and name. * @param environment the environment that needs to be modified * @param type the type of {@link PropertySource} to be added. See {@link Type} * @param name the name for the property source */ public void applyTo(ConfigurableEnvironment environment, Type type, String name) { Assert.notNull(environment, "Environment must not be null"); Assert.notNull(type, "Property source type must not be null"); Assert.notNull(name, "Property source name must not be null"); MutablePropertySources sources = environment.getPropertySources(); addToSources(sources, type, name); ConfigurationPropertySources.attach(environment); }