public abstract class AbstractPropertySourceLoader extends 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 |
---|---|
int |
getOrder() |
Optional<PropertySource> |
load(String resourceName,
ResourceLoader resourceLoader,
String environmentName)
Load a
PropertySource for the given Environment . |
protected abstract void |
processInput(String name,
InputStream input,
Map<String,Object> finalMap) |
protected void |
processMap(Map<String,Object> finalMap,
Map map,
String prefix) |
Map<String,Object> |
read(String name,
InputStream input)
Read a property source from an input stream.
|
protected Optional<InputStream> |
readInput(ResourceLoader resourceLoader,
String fileName) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
load
isEnabled
getExtensions, read
public static final int DEFAULT_POSITION
public int getOrder()
public Optional<PropertySource> load(String resourceName, ResourceLoader resourceLoader, String environmentName)
PropertySourceLoader
PropertySource
for the given Environment
.load
in interface PropertySourceLoader
resourceName
- The resourceName of the resource to loadresourceLoader
- The ResourceLoader
to retrieve the resourceenvironmentName
- The environment name to load. Null if the default environment is to be usedPropertySource
public Map<String,Object> read(String name, InputStream input) throws IOException
PropertySourceReader
read
in interface PropertySourceReader
name
- The name of the property sourceinput
- The bytesIOException
- if there is an error processing the property sourceprotected Optional<InputStream> readInput(ResourceLoader resourceLoader, String fileName)
resourceLoader
- The resource loaderfileName
- The file nameOptional
protected abstract void processInput(String name, InputStream input, Map<String,Object> finalMap) throws IOException
name
- The nameinput
- The input streamfinalMap
- The map with all the properties processedIOException
- If the input stream doesn't exist