public abstract class AbstractPropertySourceLoader extends java.lang.Object implements PropertySourceLoader, Toggleable, Ordered
PropertySourceLoader interface.| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_POSITION
Default position for the property source loader.
|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
AbstractPropertySourceLoader() |
| Modifier and Type | Method and Description |
|---|---|
protected MapPropertySource |
createPropertySource(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> map,
int order) |
int |
getOrder() |
java.util.Optional<PropertySource> |
load(java.lang.String resourceName,
ResourceLoader resourceLoader)
Load a
PropertySource for the given Environment. |
java.util.Optional<PropertySource> |
loadEnv(java.lang.String resourceName,
ResourceLoader resourceLoader,
ActiveEnvironment activeEnvironment)
Load a
PropertySource for the given Environment. |
protected abstract void |
processInput(java.lang.String name,
java.io.InputStream input,
java.util.Map<java.lang.String,java.lang.Object> finalMap) |
protected void |
processMap(java.util.Map<java.lang.String,java.lang.Object> finalMap,
java.util.Map map,
java.lang.String prefix) |
java.util.Map<java.lang.String,java.lang.Object> |
read(java.lang.String name,
java.io.InputStream input)
Read a property source from an input stream.
|
protected java.util.Optional<java.io.InputStream> |
readInput(ResourceLoader resourceLoader,
java.lang.String fileName) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitloadisEnabledgetExtensions, readpublic static final int DEFAULT_POSITION
public int getOrder()
public java.util.Optional<PropertySource> load(java.lang.String resourceName, ResourceLoader resourceLoader)
PropertySourceLoaderPropertySource for the given Environment.load in interface PropertySourceLoaderresourceName - The resourceName of the resource to loadresourceLoader - The ResourceLoader to retrieve the resourcePropertySourcepublic java.util.Optional<PropertySource> loadEnv(java.lang.String resourceName, ResourceLoader resourceLoader, ActiveEnvironment activeEnvironment)
PropertySourceLoaderPropertySource for the given Environment.loadEnv in interface PropertySourceLoaderresourceName - The resourceName of the resource to loadresourceLoader - The ResourceLoader to retrieve the resourceactiveEnvironment - The environment to loadPropertySourceprotected MapPropertySource createPropertySource(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> map, int order)
name - The name of the property sourcemap - The maporder - The order of the property sourcepublic java.util.Map<java.lang.String,java.lang.Object> read(java.lang.String name,
java.io.InputStream input)
throws java.io.IOException
PropertySourceReaderread in interface PropertySourceReadername - The name of the property sourceinput - The bytesjava.io.IOException - if there is an error processing the property sourceprotected java.util.Optional<java.io.InputStream> readInput(ResourceLoader resourceLoader, java.lang.String fileName)
resourceLoader - The resource loaderfileName - The file nameOptionalprotected abstract void processInput(java.lang.String name,
java.io.InputStream input,
java.util.Map<java.lang.String,java.lang.Object> finalMap)
throws java.io.IOException
name - The nameinput - The input streamfinalMap - The map with all the properties processedjava.io.IOException - If the input stream doesn't existprotected void processMap(java.util.Map<java.lang.String,java.lang.Object> finalMap,
java.util.Map map,
java.lang.String prefix)
finalMap - The map with all the properties processedmap - The map to processprefix - The prefix for the keys