public class ConfigParser
extends java.lang.Object
| Constructor and Description |
|---|
ConfigParser() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addValue(java.lang.String key,
java.lang.String value)
Here, a user can add his Value(s) under his specified key.
|
static void |
deleteAllAt(java.lang.String key)
deletes the Value(s) stored by the given key so that new ones can be
added without keeping the old ones
|
static java.io.File |
getConfigFile()
Returns the config file
|
static java.lang.String[] |
getValue(java.lang.String key)
returns the value(s) under the given key/tagname as a String-Array.
|
static boolean |
isCorrectlyInitialized()
Checks if the data has already been loaded properly from the file.
|
static void |
readDataFromDisc()
restores the Hasttable from the cfg_file.
|
static void |
setConfigFile(java.io.File confile)
Sets the path of the Config File;
|
static void |
writeDataToDisc()
writes all values to the config-file
|
public static void addValue(java.lang.String key,
java.lang.String value)
key - - the key for your value;will also be the name of the tag in
the cfg_filevalue - - the value as a stringpublic static java.lang.String[] getValue(java.lang.String key)
throws java.lang.Exception
key - the key for your Value(s)java.lang.Exception - if no data is availablepublic static void deleteAllAt(java.lang.String key)
key - - the keypublic static void writeDataToDisc()
throws java.lang.Exception
java.io.IOExceptionjava.lang.Exceptionpublic static void readDataFromDisc()
throws java.lang.Exception
java.io.IOExceptionjava.lang.Exceptionpublic static boolean isCorrectlyInitialized()
public static void setConfigFile(java.io.File confile)
confile - public static java.io.File getConfigFile()