|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Dictionary<K,V> java.util.Hashtable<java.lang.Object,java.lang.Object> java.util.Properties com.creamtec.core.AppProperties
public class AppProperties
AppProperties extends java.util.Properties and adds convenience methods for reading properties from a file and getting typed properties such as boolean and int
Constructor Summary | |
---|---|
AppProperties()
Instantiates the object |
|
AppProperties(java.util.Properties defaults)
Instantiates the object populated with default values |
|
AppProperties(java.lang.String fileName)
Instantiates the object and reads the properties from a given file |
|
AppProperties(java.lang.String fileName,
boolean trace)
Instantiates the object and reads the properties from a given file |
Method Summary | |
---|---|
java.lang.String |
getAppName()
|
boolean |
getBooleanProperty(java.lang.String key,
boolean defValue)
Returns a value of the boolean property |
java.lang.String |
getFileName()
Returns the file name that was used to load the properties |
int |
getIntProperty(java.lang.String key,
int defValue)
Returns a value of the int property |
void |
setAppName(java.lang.String appName)
|
void |
setBooleanProperty(java.lang.String key,
boolean value)
Sets the value of a boolean property |
void |
setIntProperty(java.lang.String key,
int value)
Sets the value of an int property |
Methods inherited from class java.util.Properties |
---|
getProperty, getProperty, list, list, load, loadFromXML, propertyNames, save, setProperty, store, storeToXML, storeToXML |
Methods inherited from class java.util.Hashtable |
---|
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, remove, size, toString, values |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AppProperties(java.lang.String fileName)
fileName
- name of the filepublic AppProperties(java.lang.String fileName, boolean trace)
fileName
- name of the filetrace
- if true, a log message will be written indicating the progress of loadingpublic AppProperties(java.util.Properties defaults) throws java.lang.Exception
defaults
- Properties
java.lang.Exception
public AppProperties()
java.lang.Exception
Method Detail |
---|
public java.lang.String getAppName()
public void setAppName(java.lang.String appName)
public boolean getBooleanProperty(java.lang.String key, boolean defValue)
key
- property namedefValue
- default value that should be used if the property has no value
public void setBooleanProperty(java.lang.String key, boolean value)
key
- property namevalue
- valuepublic int getIntProperty(java.lang.String key, int defValue)
key
- property namedefValue
- default value that should be used if the property has no value
public void setIntProperty(java.lang.String key, int value)
key
- property namevalue
- valuepublic java.lang.String getFileName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |