Package io.micronaut.jackson.core.env
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:
PropertySourceLoader
,PropertySourceLocator
,PropertySourceReader
,Ordered
,Toggleable
- Direct Known Subclasses:
CloudFoundryVcapApplicationPropertySourceLoader
,CloudFoundryVcapServicesPropertySourceLoader
Reads properties from JSON stored in the environment variables SPRING_APPLICATION_JSON
or MICRONAUT_APPLICATION_JSON
.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Position for the system property source loader in the chain.Fields inherited from class io.micronaut.jackson.core.env.JsonPropertySourceLoader
FILE_EXTENSION
Fields inherited from class io.micronaut.context.env.AbstractPropertySourceLoader
DEFAULT_POSITION, log
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
protected Optional<InputStream>
int
getOrder()
protected Optional<InputStream>
readInput
(ResourceLoader resourceLoader, String fileName) Methods inherited from class io.micronaut.jackson.core.env.JsonPropertySourceLoader
getExtensions, processInput, readJsonAsMap
Methods inherited from class io.micronaut.context.env.AbstractPropertySourceLoader
createPropertySource, isLogEnabled, load, loadEnv, processMap, read, setLogEnabled
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.context.env.PropertySourceLoader
load
Methods inherited from interface io.micronaut.context.env.PropertySourceReader
read
Methods inherited from interface io.micronaut.core.util.Toggleable
isEnabled
-
Field Details
-
POSITION
public static final int POSITIONPosition 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 interfaceOrdered
- Overrides:
getOrder
in classAbstractPropertySourceLoader
- Returns:
- The order of the object. Defaults to zero (no order).
-
readInput
- Overrides:
readInput
in classAbstractPropertySourceLoader
- Parameters:
resourceLoader
- The resource loaderfileName
- The file name- Returns:
- An input stream wrapped inside an
Optional
-
getEnvValueAsStream
- Returns:
- The JSON as input stream stored in the environment variables
SPRING_APPLICATION_JSON
orMICRONAUT_APPLICATION_JSON
.
-
getEnvValue
- Returns:
- The JSON stored in the environment variables
SPRING_APPLICATION_JSON
orMICRONAUT_APPLICATION_JSON
.
-