|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.cafesoft.cams.util.ConfigSupport
A Helper class that performs common functions on Config Objects
Config| Constructor Summary | |
ConfigSupport()
|
|
| Method Summary | |
static boolean |
getBooleanParam(Config config,
String paramName,
boolean defaultValue)
Get a boolean param from the Config object |
static Properties |
getInitProperties(Config config)
Get the initial parameters from the Config object and put them into a new Properties object This method is useful in situations where a Properties object is used to initialize an Object and the parent Object has a Config Object instead. |
static Properties |
getProperties(Config config)
Extracts the properties contained within the config. |
static int |
getRequiredIntParam(Config config,
String source,
String paramName,
int defaultValue,
Logger logger)
Get an Integer parameter from the Config object |
static String |
getRequiredStringParam(Config config,
String source,
String paramName,
String defaultValue,
Logger logger)
Get a required String param from the Config object |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ConfigSupport()
| Method Detail |
public static final Properties getInitProperties(Config config)
This method is useful in situations where a Properties object is used to initialize an Object and the parent Object has a Config Object instead.
config - the Config object that contains the initial parameters
public static final int getRequiredIntParam(Config config,
String source,
String paramName,
int defaultValue,
Logger logger)
config - the Config object that contains all initialization
parameterssource - the source object that is attempting to get the
parameter. This value is used to give a contextual
warning message.paramName - the name of the Parameter for which to retreive the
integer valuedefaultValue - the default value to use if a valid integer can
not be evaluated.logger - the logger to log warning messages to
public static final String getRequiredStringParam(Config config,
String source,
String paramName,
String defaultValue,
Logger logger)
config - the Config object that contains all initialization
properties.source - the source object that is attempting to get the
parameter. This value is used to give a contextual
warning message.paramName - the name of the Parameter for which to retreive
the String value.defaultValue - the default value to use if the parameter
is not defined in the config object.logger - the logger to log warning messages to
public static final boolean getBooleanParam(Config config,
String paramName,
boolean defaultValue)
config - the Config object to get the boolean value fromparamName - the parameter name of the boolean valuedefaultValue - the default value if the parameter is not found in the
Config object
public static Properties getProperties(Config config)
config - contains configuration properties
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||