Class EnvConfigSource
- java.lang.Object
-
- io.smallrye.config.common.AbstractConfigSource
-
- io.smallrye.config.EnvConfigSource
-
- All Implemented Interfaces:
Serializable,org.eclipse.microprofile.config.spi.ConfigSource
public class EnvConfigSource extends AbstractConfigSource
AConfigSourceto access Environment Variables.A property name matches to an environment variable with the following rules:
- Match alphanumeric characters (any case)
- Match non-alphanumeric characters with
_ - Closing quotes in the end of a property name require a double
_
Additionally, this implementation provides candidate matching dotted property name from the Environment Variable name. These are required when a consumer relies on the list of properties to find additional configurations. The MicroProfile Config specification defines a set of conversion rules to look up and find values from environment variables even when using their dotted version, but it is unclear about property names.
Because an environment variable name may only be represented by a subset of characters, it is not possible to represent exactly a dotted version name from an environment variable name, so consumers must be aware of such limitations.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedEnvConfigSource()protectedEnvConfigSource(int ordinal)EnvConfigSource(Map<String,String> properties, int ordinal)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>getProperties()Set<String>getPropertyNames()StringgetValue(String propertyName)-
Methods inherited from class io.smallrye.config.common.AbstractConfigSource
getName, getOrdinal, toString
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
ORDINAL
public static final int ORDINAL
- See Also:
- Constant Field Values
-
-