public class PropertiesLoader extends Object
For more info please see the Tutorials.
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger
The internal slf4j logger.
|
private Properties |
properties
Properties from the property file.
|
| Constructor and Description |
|---|
PropertiesLoader(List<String> fileNames,
Class<?> loaderClass)
Reads the property files and creates a new PropertiesLoader instance.
|
PropertiesLoader(String fileName,
Class<?> loaderClass)
Reads the property file and creates a new PropertiesLoader instance.
|
| Modifier and Type | Method and Description |
|---|---|
String |
get(String name)
Returns the named property value from the property file.
|
Properties |
getProperties()
Returns all properties.
|
static Properties |
getProperties(Class<?> loaderClass,
String... fileNames)
Reads the property files and creates a new PropertiesLoader instance.
|
static Properties |
getProperties(Class<?> loaderClass,
String fileName)
Reads the property file and creates a new PropertiesLoader instance.
|
private Properties |
load(String fileName,
Class<?> loaderClass)
Reads the property file and creates a new Properties instance.
|
protected final org.slf4j.Logger logger
private Properties properties
public PropertiesLoader(String fileName, Class<?> loaderClass)
fileName - The name of the file to be read.loaderClass - Class used to detect the correct classloader.public static Properties getProperties(Class<?> loaderClass, String fileName)
fileName - The name of the file to be read.loaderClass - Class used to detect the correct classloader.public static Properties getProperties(Class<?> loaderClass, String... fileNames)
fileNames - The names of the files to be read.loaderClass - Class used to detect the correct classloader.private Properties load(String fileName, Class<?> loaderClass)
fileName - The name of the file to be read.loaderClass - Class used to detect the correct classloader.public String get(String name)
name - the name (=key in the property file)public Properties getProperties()
Copyright © 2016. All rights reserved.