|
TsBiff 1.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--ts.config.Config
This final class holds universal application properties, as well as java default properties from java.lang.System. The class uses a static initializer to load default properties at loadtime. Using the singleton pattern to have only one instance of Config.
| Field Summary | |
static int |
NO_INT_VALUE
|
| Method Summary | |
static java.lang.String |
get(java.lang.String key)
Get String value for given property. |
static java.lang.String |
get(java.lang.String key,
java.lang.String def)
Get String value for given property. |
static boolean |
getboolean(java.lang.String key)
Get boolean value for given property |
static java.lang.Boolean |
getBoolean(java.lang.String key)
Get Boolean value for given property |
static boolean |
getboolean(java.lang.String key,
boolean def)
Get boolean value for given property. |
static java.lang.Boolean |
getBoolean(java.lang.String key,
java.lang.Boolean def)
Get Boolean value for given property. |
static java.awt.Color |
getColor(java.lang.String key)
Get Color value for given property. |
static java.lang.String[] |
getCValues(java.lang.String key)
Get a String array for the given property. |
static java.awt.Font |
getFont(java.lang.String key)
Get Font value for given property. |
static Config |
getInstance()
Returns the Config instance singleton |
static int |
getint(java.lang.String key)
Get int value for given property. |
static int |
getint(java.lang.String key,
int def)
Get int value for given property. |
static java.lang.Integer |
getInteger(java.lang.String key)
Get Integer value for given property. |
static java.lang.Integer |
getInteger(java.lang.String key,
java.lang.Integer def)
Get Integer value for given property. |
static int[] |
getIntValues(java.lang.String key)
Get an int array for the given property. |
static java.lang.String[] |
getValues(java.lang.String key)
Get a String array for the given property. |
void |
list()
List properties to stdout |
void |
load(java.io.File file)
Load properties from file. |
void |
load(java.lang.String file)
Load properties from file using filename as locator |
void |
save(java.io.File file)
Save properties to the submitted File |
void |
save(java.lang.String file)
Save properties to the submitted filename |
static void |
set(java.lang.String key,
java.lang.String value)
Set value for given property. |
java.lang.String |
toString()
Composes string containing all properties and their values |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static int NO_INT_VALUE
| Method Detail |
public static Config getInstance()
public void load(java.io.File file)
throws ConfigException
file - A properties File objectConfigException - if invalid file
public void load(java.lang.String file)
throws ConfigException
file - A string containing a filenameConfigException - if invalid file
public void save(java.io.File file)
throws ConfigException
ConfigException - if could not save properties file
public void save(java.lang.String file)
throws ConfigException
ConfigException - if could not save properties file
public static void set(java.lang.String key,
java.lang.String value)
key - a keyvalue - the value for the keypublic static java.lang.String[] getValues(java.lang.String key)
key - A keypublic static java.lang.String[] getCValues(java.lang.String key)
key - A keypublic static int[] getIntValues(java.lang.String key)
key - A keypublic static java.lang.String get(java.lang.String key)
key - A key
public static java.lang.String get(java.lang.String key,
java.lang.String def)
key - A keydef - the default value to return if no value is foundpublic static java.lang.Integer getInteger(java.lang.String key)
key - A key
public static java.lang.Integer getInteger(java.lang.String key,
java.lang.Integer def)
key - A keydef - the default value to return if no value is foundpublic static java.lang.Boolean getBoolean(java.lang.String key)
key - A key
public static java.lang.Boolean getBoolean(java.lang.String key,
java.lang.Boolean def)
key - A keydef - the default value to return if no value is foundpublic static java.awt.Font getFont(java.lang.String key)
key - A keypublic static java.awt.Color getColor(java.lang.String key)
key - A keypublic static int getint(java.lang.String key)
key - A key
public static int getint(java.lang.String key,
int def)
key - A keydef - the default value to return if no value is foundpublic static boolean getboolean(java.lang.String key)
key - A key
public static boolean getboolean(java.lang.String key,
boolean def)
key - A keydef - the default value to return if no value is foundpublic java.lang.String toString()
toString in class java.lang.Objectpublic void list()
|
TsBiff 1.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||