|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.util.Dictionary
|
+--java.util.Hashtable
|
+--java.util.Properties
|
+--com.zwares.base.util.Configuration
This class reads the configuration file and returns requested data types. It extends Properties. It provides a richer set of methods that convert the configuration value to other data types.
| Nested Class Summary |
| Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
| Field Summary |
| Fields inherited from class java.util.Properties |
defaults |
| Constructor Summary | |
Configuration(java.lang.String name)
Creates a new Configuration. |
|
| Method Summary | |
boolean |
doesFileExist()
Returns if the configuration file exists. |
java.lang.String |
get(java.lang.String key)
Returns the string value associated to the given key. |
boolean |
getB(java.lang.String key)
Returns the boolean value associated to the given key. |
boolean |
getB(java.lang.String key,
boolean defaultVal)
Returns the boolean value associated to the given key using the specified default. |
char |
getC(java.lang.String key)
Returns the character value associated to the given key. |
double |
getD(java.lang.String key)
Returns the double value associated to the given key. |
double |
getD(java.lang.String key,
double defaultVal)
Returns the double value associated to the given key using the specified default. |
double[] |
getDoubleArray(java.lang.String key)
Returns the double array value associated to the given key. |
double[] |
getDoubleArray(java.lang.String key,
java.lang.String delimiter)
Returns the double array value associated to the given key. |
int |
getI(java.lang.String key)
Returns the integer value associated to the given key. |
int |
getI(java.lang.String key,
int defaultVal)
Returns the integer value associated to the given key using the specified default |
java.io.InputStream |
getInputStream(java.lang.String filePath)
This routine returns an InputStream matching the filePath. |
java.lang.String |
getS(java.lang.String key)
Returns the string value associated to the given key. |
java.lang.String |
getS(java.lang.String key,
java.lang.String defaultVal)
Returns the string value associated to the given key using the specified default. |
java.lang.String[] |
getStringArray(java.lang.String key)
Returns the string array value associated to the given key. |
java.lang.String[] |
getStringArray(java.lang.String key,
java.lang.String delimiter)
Returns the string array value associated to the given key. |
| Methods inherited from class java.util.Properties |
getProperty, getProperty, list, list, load, propertyNames, save, setProperty, store |
| Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Configuration(java.lang.String name)
name - The configuration file can be found at the file name.| Method Detail |
public boolean doesFileExist()
public java.lang.String get(java.lang.String key)
public java.lang.String getS(java.lang.String key)
public java.lang.String getS(java.lang.String key,
java.lang.String defaultVal)
public java.lang.String[] getStringArray(java.lang.String key)
public java.lang.String[] getStringArray(java.lang.String key,
java.lang.String delimiter)
public double[] getDoubleArray(java.lang.String key)
public double[] getDoubleArray(java.lang.String key,
java.lang.String delimiter)
public char getC(java.lang.String key)
public int getI(java.lang.String key)
public int getI(java.lang.String key,
int defaultVal)
public boolean getB(java.lang.String key)
public boolean getB(java.lang.String key,
boolean defaultVal)
public double getD(java.lang.String key)
public double getD(java.lang.String key,
double defaultVal)
public java.io.InputStream getInputStream(java.lang.String filePath)
filePath - Could be any of the following
1. absoulate path (/com/zwares/config/init.prop)
2. relative path (com/zwares/config/init.prop)
3. file name (init.prop)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||