public class CompositePropertyLoader extends java.lang.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.
|
java.lang.String |
getProperty(java.lang.String key)
Gets the value mapped with the specified key.
|
java.lang.String |
getProperty(java.lang.String key,
java.lang.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.java.lang.NullPointerException
- if the given property loader is null
.@Nullable public java.lang.String getProperty(java.lang.String key)
PropertyLoader
getProperty
in interface PropertyLoader
key
- the key.null
if the property is not found.public java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
PropertyLoader
getProperty
in interface PropertyLoader
key
- the key.defaultValue
- the default value.