com.norbl.util
Class ParamHt

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<java.lang.String,java.lang.String>
          extended by 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 Class Summary
static class ParamHt.ParamName
           
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
 java.io.File configFile
           
 java.lang.String configFilenameDefault
           
 
Constructor Summary
ParamHt(java.lang.String[] argv, java.lang.String configFilenameDefault)
           
 
Method Summary
static java.lang.String getDefaultConfigFilePath(java.lang.String configFilename)
           
 boolean reloadParams()
          Loads params from the param file.
 void saveAndReload()
           
 void saveAndReload(boolean showFileWrit)
          Writes params to the config file then reloads the params from that file.
 void show()
           
 void writeToConfigFile()
           
 void writeToConfigFile(boolean showFileWrit)
          Writes the current params to the config file.
 
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
 

Field Detail

configFile

public java.io.File configFile

configFilenameDefault

public java.lang.String configFilenameDefault
Constructor Detail

ParamHt

public ParamHt(java.lang.String[] argv,
               java.lang.String configFilenameDefault)
        throws InaccessibleFileException,
               java.io.IOException
Throws:
InaccessibleFileException
java.io.IOException
Method Detail

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()