|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.any23.configuration.DefaultConfiguration
public class DefaultConfiguration
Default implementation of Configuration
.
The default property values are read from the
/default-configuration.properties properties file
in classpath.
Field Summary | |
---|---|
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
|
Constructor Summary | |
---|---|
protected |
DefaultConfiguration(Properties properties)
|
Method Summary | |
---|---|
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()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
protected DefaultConfiguration(Properties properties)
Method Detail |
---|
public static DefaultConfiguration singleton()
public static ModifiableConfiguration copy()
public String[] getProperties()
Configuration
getProperties
in interface Configuration
public boolean defineProperty(String propertyName)
Configuration
defineProperty
in interface Configuration
propertyName
- name of property to check.
true
if defined, false otherwise.public String getProperty(String propertyName, String defaultValue)
Configuration
getProperty
in interface Configuration
propertyName
- name of propertydefaultValue
- default value if not found.
public String getPropertyOrFail(String propertyName)
Configuration
propertyName
or raises an exception
if propertyName
is not defined.
getPropertyOrFail
in interface Configuration
propertyName
- name of property to be returned.
public int getPropertyIntOrFail(String propertyName)
Configuration
Integer
value of the specified propertyName
or raises an exception
if propertyName
is not defined.
getPropertyIntOrFail
in interface Configuration
propertyName
- name of property to be returned.
public boolean getFlagProperty(String propertyName)
Configuration
on
if flag is active (true
is returned).
off
if flag is inactive (false
is returned).
getFlagProperty
in interface Configuration
propertyName
- name of property flag.
true
for on
, false
for off
.public String getConfigurationDump()
Configuration
getConfigurationDump
in interface Configuration
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |