Package io.micronaut.jackson.env
Class JsonPropertySourceLoader
java.lang.Object
io.micronaut.context.env.AbstractPropertySourceLoader
io.micronaut.jackson.env.JsonPropertySourceLoader
- All Implemented Interfaces:
PropertySourceLoader
,PropertySourceLocator
,PropertySourceReader
,Ordered
,Toggleable
A PropertySourceLoader
that reads application.json
files if they exist.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
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 void
processInput
(String name, InputStream input, Map<String, Object> finalMap) readJsonAsMap
(InputStream input) Methods inherited from class io.micronaut.context.env.AbstractPropertySourceLoader
createPropertySource, getOrder, isLogEnabled, load, loadEnv, processMap, read, readInput, 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
-
FILE_EXTENSION
File extension for property source loader.- See Also:
-
-
Constructor Details
-
JsonPropertySourceLoader
public JsonPropertySourceLoader() -
JsonPropertySourceLoader
public JsonPropertySourceLoader(boolean logEnabled)
-
-
Method Details
-
getExtensions
- Returns:
- The extensions this reader supports.
-
processInput
protected void processInput(String name, InputStream input, Map<String, Object> finalMap) throws IOException- Specified by:
processInput
in classAbstractPropertySourceLoader
- Parameters:
name
- The nameinput
- The input streamfinalMap
- The map with all the properties processed- Throws:
IOException
- If the input stream doesn't exist
-
readJsonAsMap
- Parameters:
input
- The input stream- Returns:
- map representation of the json
- Throws:
IOException
- If the input stream doesn't exist
-