Class EnvJsonPropertySourceLoader

java.lang.Object
io.micronaut.context.env.AbstractPropertySourceLoader
io.micronaut.jackson.core.env.JsonPropertySourceLoader
io.micronaut.jackson.core.env.EnvJsonPropertySourceLoader
All Implemented Interfaces:
io.micronaut.context.env.PropertySourceLoader, io.micronaut.context.env.PropertySourceLocator, io.micronaut.context.env.PropertySourceReader, io.micronaut.core.order.Ordered, io.micronaut.core.util.Toggleable
Direct Known Subclasses:
CloudFoundryVcapApplicationPropertySourceLoader, CloudFoundryVcapServicesPropertySourceLoader

@Internal public class EnvJsonPropertySourceLoader extends JsonPropertySourceLoader

Reads properties from JSON stored in the environment variables SPRING_APPLICATION_JSON or MICRONAUT_APPLICATION_JSON.

Since:
1.0
  • Field Details

    • POSITION

      public static final int POSITION
      Position for the system property source loader in the chain.
      See Also:
  • Constructor Details

    • EnvJsonPropertySourceLoader

      public EnvJsonPropertySourceLoader()
    • EnvJsonPropertySourceLoader

      public EnvJsonPropertySourceLoader(boolean logEnabled)
  • Method Details

    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface io.micronaut.core.order.Ordered
      Overrides:
      getOrder in class io.micronaut.context.env.AbstractPropertySourceLoader
    • readInput

      protected Optional<InputStream> readInput(io.micronaut.core.io.ResourceLoader resourceLoader, String fileName)
      Overrides:
      readInput in class io.micronaut.context.env.AbstractPropertySourceLoader
    • getEnvValueAsStream

      protected Optional<InputStream> getEnvValueAsStream()
      Returns:
      The JSON as input stream stored in the environment variables SPRING_APPLICATION_JSON or MICRONAUT_APPLICATION_JSON.
    • getEnvValue

      protected String getEnvValue()
      Returns:
      The JSON stored in the environment variables SPRING_APPLICATION_JSON or MICRONAUT_APPLICATION_JSON.