com.norbl.util
Class ParamHt
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<java.lang.String,java.lang.String>
com.norbl.util.ParamHt
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.lang.String>
- Direct Known Subclasses:
- AwsClientConfigParams, ParamHtPPE
public abstract class ParamHt
- extends java.util.HashMap<java.lang.String,java.lang.String>
A hash table of string param values keyed by parm names. Keys
are stored as lowercase. This
class contains the methods for reading param files and
parsing argv. This class does not check or interpret params in any
way - that is the responsibility of concrete subclasses of
AbstractParams
that use this class as a source of param values.
Concrete subclasses typically have a hardcoded configFilenameDefault.
- See Also:
- Serialized Form
Nested classes/interfaces inherited from class java.util.AbstractMap |
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
Constructor Summary |
ParamHt(java.lang.String[] argv,
java.lang.String configFilenameDefault)
|
Methods inherited from class java.util.HashMap |
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
configFile
public java.io.File configFile
configFilenameDefault
public java.lang.String configFilenameDefault
ParamHt
public ParamHt(java.lang.String[] argv,
java.lang.String configFilenameDefault)
throws InaccessibleFileException,
java.io.IOException
- Throws:
InaccessibleFileException
java.io.IOException
reloadParams
public boolean reloadParams()
- Loads params from the param file.
- Returns:
getDefaultConfigFilePath
public static java.lang.String getDefaultConfigFilePath(java.lang.String configFilename)
writeToConfigFile
public void writeToConfigFile()
writeToConfigFile
public void writeToConfigFile(boolean showFileWrit)
- Writes the current params to the config file.
If a configFile exists, it is renamed per
FileUtil.getBackupFilename(java.io.File)
and
the updated params are written to the specified file name.
- Parameters:
configFile
-
saveAndReload
public void saveAndReload(boolean showFileWrit)
- Writes params to the config file then reloads the params from that file.
saveAndReload
public void saveAndReload()
show
public void show()