|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.jhu.tmaj.util.config.data.ConstantsHolder
public final class ConstantsHolder
A Helper class for reading config files. Every jar file created contains a config file in the /config directory. It is possible that a config file outside of the jar may override the values of the original config file. This file is referred to as the override file. The methods override(filename) where filename is the name of the override file. Any values in the original config file will be overwritten.
Constructor Summary | |
---|---|
ConstantsHolder(java.util.Properties properties,
java.lang.String propertiesFileName,
java.util.List<? extends ConfigKey> configKeyList)
Constructs this object. |
Method Summary | |
---|---|
boolean |
getBoolean(ConfigKey configKey)
Gets the boolean value for a config key that has a boolean type. |
static ConstantsHolder |
getInstanceFromExternalProperties(java.io.File propertiesFile,
java.util.List<? extends ConfigKey> configKeyList)
|
static ConstantsHolder |
getInstanceFromInternalProperties(java.lang.String propertiesFileName,
java.util.List<? extends ConfigKey> configKeyList)
|
java.lang.Integer |
getInt(ConfigKey configKey)
Gets the int value for a config key that is an int type. |
java.lang.String |
getString(ConfigKey configKey)
Gets the string value for a config key that is an string type. |
java.net.URL |
getURL(ConfigKey configKey)
|
void |
override(java.io.File overrideFile)
Override the config file with another config file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConstantsHolder(java.util.Properties properties, java.lang.String propertiesFileName, java.util.List<? extends ConfigKey> configKeyList)
propertiesFileName
- the internal properies file. Example: config/client.propertiesconfigKeyList
- all the possible configKeys that may be found in the properties fileMethod Detail |
---|
public static ConstantsHolder getInstanceFromInternalProperties(java.lang.String propertiesFileName, java.util.List<? extends ConfigKey> configKeyList)
public static ConstantsHolder getInstanceFromExternalProperties(java.io.File propertiesFile, java.util.List<? extends ConfigKey> configKeyList)
public java.lang.Integer getInt(ConfigKey configKey)
public java.lang.String getString(ConfigKey configKey)
public java.net.URL getURL(ConfigKey configKey)
public boolean getBoolean(ConfigKey configKey)
public void override(java.io.File overrideFile)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |