Module io.inverno.mod.configuration
Class PropertiesConfigurationSource
java.lang.Object
io.inverno.mod.configuration.AbstractConfigurationSource<AbstractHashConfigurationSource.HashConfigurationQuery<String,PropertiesConfigurationSource>,AbstractHashConfigurationSource.HashExecutableConfigurationQuery<String,PropertiesConfigurationSource>,AbstractHashConfigurationSource.HashListConfigurationQuery<String,PropertiesConfigurationSource>,String>
io.inverno.mod.configuration.AbstractHashConfigurationSource<String,PropertiesConfigurationSource>
io.inverno.mod.configuration.source.PropertiesConfigurationSource
- All Implemented Interfaces:
ConfigurationSource<AbstractHashConfigurationSource.HashConfigurationQuery<String,
,PropertiesConfigurationSource>, AbstractHashConfigurationSource.HashExecutableConfigurationQuery<String, PropertiesConfigurationSource>, AbstractHashConfigurationSource.HashListConfigurationQuery<String, PropertiesConfigurationSource>> DefaultableConfigurationSource<AbstractHashConfigurationSource.HashConfigurationQuery<String,
PropertiesConfigurationSource>, AbstractHashConfigurationSource.HashExecutableConfigurationQuery<String, PropertiesConfigurationSource>, AbstractHashConfigurationSource.HashListConfigurationQuery<String, PropertiesConfigurationSource>, PropertiesConfigurationSource>
public class PropertiesConfigurationSource
extends AbstractHashConfigurationSource<String,PropertiesConfigurationSource>
A configuration source backed by a Properties
object.
This source supports parameterized configuration properties defined as follows:
Properties properties = new Properties();
properties.setProperty("web.server_port", "8080");
properties.setProperty("web.server_port[profile=\"ssl\"]", "8443");
properties.setProperty("db.url[env=\"dev\"]", "jdbc:oracle:thin:@dev.db.server:1521:sid");
properties.setProperty("db.url[env=\"prod\",zone=\"eu\"]", "jdbc:oracle:thin:@prod_eu.db.server:1521:sid");
properties.setProperty("db.url[env=\"prod\",zone=\"us\"]", "jdbc:oracle:thin:@prod_us.db.server:1521:sid");
- Since:
- 1.6
- Author:
- Jeremy Kuhn
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.inverno.mod.configuration.AbstractHashConfigurationSource
AbstractHashConfigurationSource.HashConfigurationQuery<A,
B extends AbstractHashConfigurationSource<A, B>>, AbstractHashConfigurationSource.HashConfigurationQueryResult<A, B extends AbstractHashConfigurationSource<A, B>>, AbstractHashConfigurationSource.HashExecutableConfigurationQuery<A, B extends AbstractHashConfigurationSource<A, B>>, AbstractHashConfigurationSource.HashListConfigurationQuery<A, B extends AbstractHashConfigurationSource<A, B>> -
Field Summary
Fields inherited from class io.inverno.mod.configuration.AbstractHashConfigurationSource
defaultingStrategy, initial
Fields inherited from class io.inverno.mod.configuration.AbstractConfigurationSource
decoder
-
Constructor Summary
ConstructorDescriptionPropertiesConfigurationSource
(Properties properties) Creates a properties configuration source with the specifiedProperties
.PropertiesConfigurationSource
(Properties properties, SplittablePrimitiveDecoder<String> decoder) Creates a properties configuration source with the specifiedProperties
and the specified string value decoder. -
Method Summary
Modifier and TypeMethodDescriptionprotected Mono
<List<ConfigurationProperty>> load()
Loads the configuration properties.withDefaultingStrategy
(DefaultingStrategy defaultingStrategy) Returns a proxy of the defaultable configuration source instance using the specified defaulting strategy.Methods inherited from class io.inverno.mod.configuration.AbstractHashConfigurationSource
get, list, unwrap
Methods inherited from class io.inverno.mod.configuration.AbstractConfigurationSource
getDecoder, setDecoder
-
Constructor Details
-
PropertiesConfigurationSource
Creates a properties configuration source with the specified
Properties
.- Parameters:
properties
- the properties
-
PropertiesConfigurationSource
public PropertiesConfigurationSource(Properties properties, SplittablePrimitiveDecoder<String> decoder) Creates a properties configuration source with the specified
Properties
and the specified string value decoder.- Parameters:
properties
- the propertiesdecoder
- a string decoder
-
-
Method Details
-
withDefaultingStrategy
Description copied from interface:DefaultableConfigurationSource
Returns a proxy of the defaultable configuration source instance using the specified defaulting strategy.
- Parameters:
defaultingStrategy
- a defaulting strategy- Returns:
- a new defaultable configuration source
-
load
Description copied from class:AbstractHashConfigurationSource
Loads the configuration properties.
- Specified by:
load
in classAbstractHashConfigurationSource<String,
PropertiesConfigurationSource> - Returns:
- A mono emitting the list of configuration properties
-