Class ConsulPropertySource
java.lang.Object
org.springframework.core.env.PropertySource<T>
org.springframework.core.env.EnumerablePropertySource<com.ecwid.consul.v1.ConsulClient>
org.springframework.cloud.consul.config.ConsulPropertySource
- Direct Known Subclasses:
ConsulFilesPropertySource
public class ConsulPropertySource
extends org.springframework.core.env.EnumerablePropertySource<com.ecwid.consul.v1.ConsulClient>
- 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
ConstructorsConstructorDescriptionConsulPropertySource(String context, com.ecwid.consul.v1.ConsulClient source, ConsulConfigProperties configProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected PropertiesgenerateProperties(String value, ConsulConfigProperties.Format format) protected ConsulConfigPropertiesprotected StringgetDecoded(String value) Deprecated.getProperty(String name) String[]voidinit()protected voidparsePropertiesInKeyValueFormat(List<com.ecwid.consul.v1.kv.model.GetValue> values) Parses the properties in key value style i.e., values are expected to be either a sub key or a constant.protected voidparsePropertiesWithNonKeyValueFormat(List<com.ecwid.consul.v1.kv.model.GetValue> values, ConsulConfigProperties.Format format) Parses the properties using the format which is not a key value style i.e., either java properties style or YAML style.protected voidparseValue(com.ecwid.consul.v1.kv.model.GetValue getValue, ConsulConfigProperties.Format format) Methods inherited from class org.springframework.core.env.EnumerablePropertySource
containsPropertyMethods inherited from class org.springframework.core.env.PropertySource
equals, getName, getSource, hashCode, named, toString
-
Constructor Details
-
ConsulPropertySource
public ConsulPropertySource(String context, com.ecwid.consul.v1.ConsulClient source, ConsulConfigProperties configProperties)
-
-
Method Details
-
init
public void init() -
getInitialIndex
-
parsePropertiesInKeyValueFormat
Parses the properties in key value style i.e., values are expected to be either a sub key or a constant.- Parameters:
values- values to parse
-
parsePropertiesWithNonKeyValueFormat
protected void parsePropertiesWithNonKeyValueFormat(List<com.ecwid.consul.v1.kv.model.GetValue> values, ConsulConfigProperties.Format format) Parses the properties using the format which is not a key value style i.e., either java properties style or YAML style.- Parameters:
values- values to parseformat- format in which the values should be parsed
-
parseValue
protected void parseValue(com.ecwid.consul.v1.kv.model.GetValue getValue, ConsulConfigProperties.Format format) -
generateProperties
-
getDecoded
Deprecated.As of 1.1.0 useGetValue.getDecodedValue().- Parameters:
value- encoded value- Returns:
- the decoded string
-
getProperties
-
getConfigProperties
-
getContext
-
getProperty
- Specified by:
getPropertyin classorg.springframework.core.env.PropertySource<com.ecwid.consul.v1.ConsulClient>
-
getPropertyNames
- Specified by:
getPropertyNamesin classorg.springframework.core.env.EnumerablePropertySource<com.ecwid.consul.v1.ConsulClient>
-
GetValue.getDecodedValue().