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 io.smallrye.config.common.AbstractConfigSource
A ConfigSource to access Environment Variables.

A property name matches to an environment variable with the following rules:

  1. Match alphanumeric characters (any case)
  2. Match non-alphanumeric characters with _
  3. 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:
  • Field Details

  • Constructor Details

    • EnvConfigSource

      protected EnvConfigSource()
    • EnvConfigSource

      protected EnvConfigSource(int ordinal)
    • EnvConfigSource

      public EnvConfigSource(Map<String,String> properties, int ordinal)
  • Method Details