Class EnvironmentPropertySource
java.lang.Object
org.springframework.core.env.PropertySource<org.springframework.cloud.config.environment.Environment>
org.springframework.cloud.config.server.support.EnvironmentPropertySource
public class EnvironmentPropertySource
extends org.springframework.core.env.PropertySource<org.springframework.cloud.config.environment.Environment>
- Author:
- Spencer Gibb
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.core.env.PropertySource
org.springframework.core.env.PropertySource.StubPropertySource -
Field Summary
Fields inherited from class org.springframework.core.env.PropertySource
logger, name, source -
Constructor Summary
ConstructorsConstructorDescriptionEnvironmentPropertySource(org.springframework.cloud.config.environment.Environment sources) -
Method Summary
Modifier and TypeMethodDescriptiongetProperty(String name) static org.springframework.core.env.StandardEnvironmentprepareEnvironment(org.springframework.cloud.config.environment.Environment environment) resolveMapPlaceholders(org.springframework.core.env.StandardEnvironment env, Map<String, Object> map) Resolve placeholders in a nested Map structure.static StringresolvePlaceholders(org.springframework.core.env.StandardEnvironment preparedEnvironment, String text) Resolve placeholders in flat text (used for .properties output).Methods inherited from class org.springframework.core.env.PropertySource
containsProperty, equals, getName, getSource, hashCode, named, toString
-
Constructor Details
-
EnvironmentPropertySource
public EnvironmentPropertySource(org.springframework.cloud.config.environment.Environment sources)
-
-
Method Details
-
prepareEnvironment
public static org.springframework.core.env.StandardEnvironment prepareEnvironment(org.springframework.cloud.config.environment.Environment environment) -
resolvePlaceholders
-
resolveMapPlaceholders
public static Map<String,Object> resolveMapPlaceholders(org.springframework.core.env.StandardEnvironment env, Map<String, Object> map) Resolve placeholders in a nested Map structure. Walks all values recursively, resolving any String values that contain ${...} expressions. Returns a new Map with resolved values — the original is not modified.Use this before serializing to YAML or JSON so that the serializer handles multiline values and escaping natively.
-
getProperty
-