public class CompositePropertyLoader extends Object implements PropertyLoader
Constructor and Description |
---|
CompositePropertyLoader()
Creates a new empty composite service loader.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyLoader(PropertyLoader propertyLoader)
Adds a property loader at the end of the list a property loaders used by this composite property loader.
|
String |
getProperty(String key)
Gets the value mapped with the specified key.
|
String |
getProperty(String key,
String defaultValue)
Gets the value mapped with the specified key or a default value.
|
public CompositePropertyLoader()
public void addPropertyLoader(PropertyLoader propertyLoader)
propertyLoader
- the property loader to add.NullPointerException
- if the given property loader is null
.@Nullable public String getProperty(String key)
PropertyLoader
getProperty
in interface PropertyLoader
key
- the key.null
if the property is not found.public String getProperty(String key, String defaultValue)
PropertyLoader
getProperty
in interface PropertyLoader
key
- the key.defaultValue
- the default value.