public class DefaultConfiguration extends Object implements Configuration
Configuration.
The default property values are read from the
/default-configuration.properties properties file
in classpath.| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CONFIG_FILE
Default configuration file.
|
static String |
FLAG_PROPERTY_OFF |
static String |
FLAG_PROPERTY_ON |
protected static org.slf4j.Logger |
logger |
protected Properties |
properties |
protected static DefaultConfiguration |
singleton |
| Modifier | Constructor and Description |
|---|---|
protected |
DefaultConfiguration(Properties properties) |
| Modifier and Type | Method and Description |
|---|---|
static ModifiableConfiguration |
copy() |
boolean |
defineProperty(String propertyName)
Checks whether a property is defined or not in configuration.
|
String |
getConfigurationDump()
Returns a human readable string containing the configuration dump.
|
boolean |
getFlagProperty(String propertyName)
Returns the value of a flag property.
|
String[] |
getProperties()
Returns all the defined configuration properties.
|
String |
getProperty(String propertyName,
String defaultValue)
Returns the value of a specified property, of the default value if property is not defined.
|
int |
getPropertyIntOrFail(String propertyName)
Returns the
Integer value of the specified propertyName or raises an exception
if propertyName is not defined. |
String |
getPropertyOrFail(String propertyName)
Returns the value of the specified
propertyName or raises an exception
if propertyName is not defined. |
static DefaultConfiguration |
singleton() |
public static final String DEFAULT_CONFIG_FILE
public static final String FLAG_PROPERTY_ON
public static final String FLAG_PROPERTY_OFF
protected static final org.slf4j.Logger logger
protected static final DefaultConfiguration singleton
protected final Properties properties
protected DefaultConfiguration(Properties properties)
public static DefaultConfiguration singleton()
public static ModifiableConfiguration copy()
public String[] getProperties()
ConfigurationgetProperties in interface Configurationpublic boolean defineProperty(String propertyName)
ConfigurationdefineProperty in interface ConfigurationpropertyName - name of property to check.true if defined, false otherwise.public String getProperty(String propertyName, String defaultValue)
ConfigurationgetProperty in interface ConfigurationpropertyName - name of propertydefaultValue - default value if not found.public String getPropertyOrFail(String propertyName)
ConfigurationpropertyName or raises an exception
if propertyName is not defined.getPropertyOrFail in interface ConfigurationpropertyName - name of property to be returned.public int getPropertyIntOrFail(String propertyName)
ConfigurationInteger value of the specified propertyName or raises an exception
if propertyName is not defined.getPropertyIntOrFail in interface ConfigurationpropertyName - name of property to be returned.public boolean getFlagProperty(String propertyName)
Configurationon if flag is active (true is returned).
off if flag is inactive (false is returned).
getFlagProperty in interface ConfigurationpropertyName - name of property flag.true for on, false for off.public String getConfigurationDump()
ConfigurationgetConfigurationDump in interface ConfigurationCopyright © 2010–2019 The Apache Software Foundation. All rights reserved.