public interface EnvironmentConfigurationLoader
The name schema for the environment variables is AMY_<config name>_<property key>.
All '.'s in the config name are replaced with '_'. The matching is done case insensitive.
A environment variable must match "[a-zA-Z_][a-zA-Z0-9_]*", so <config name>_<property key> must as
well for a configuration to be read from the environment.
| Modifier and Type | Field and Description |
|---|---|
static String |
ALLOWED_ENV_VARS_PATTERN
The patter for allowed environment variables.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isAllowedName(String name)
Checks whether the given string is an allowed name for configurations to load from the environment.
|
Properties |
load(String configurationName,
Properties original)
Load all properties set in the given original from the environment variables.
|
static final String ALLOWED_ENV_VARS_PATTERN
@Nonnull Properties load(String configurationName, @Nonnull Properties original)
This method will only load these properties that are also set in the original or its defaults recursivly.
configurationName - the name of the config.original - A property file containing settings.IllegalArgumentException - When the configuration name is not a legal environment variable name. See
EnvironmentConfigurationLoader.boolean isAllowedName(String name)
name - The name to check.Copyright © 2018. All rights reserved.