|
|||||||||
| Home >> All >> hk >> hku >> cecid >> phoenix >> common >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
hk.hku.cecid.phoenix.common.util
Class TextProperty

java.lang.Objecthk.hku.cecid.phoenix.common.util.Property
hk.hku.cecid.phoenix.common.util.TextProperty
- public class TextProperty
- extends Property
This is a concrete implementation of the property object for loading and saving the property content into a text-based file. The format used is exactly the same of Java properties file.
- Version:
- $Revision: 1.6 $
| Field Summary | |
protected java.lang.String |
fileName
Internal variable for holding the file name of the property file |
protected java.util.Properties |
prop
Internal variable for holding the Java build in Properties object for manipulation |
| Fields inherited from class hk.hku.cecid.phoenix.common.util.Property |
cache, DEFAULT_FILENAME, PROP_HOME |
| Constructor Summary | |
|
TextProperty()
Default constructor. |
(package private) |
TextProperty(java.lang.String fileName)
Internal constructor. |
| Method Summary | |
java.lang.String |
get(java.lang.String path)
Gets the property value given the path (key). |
java.lang.String |
get(java.lang.String path,
java.lang.String defaultValue)
Gets the property value given the path (key). |
java.lang.String[] |
getMultiple(java.lang.String path)
Gets the property value given the path (key). |
void |
save()
Saves the property object to the same location when loading. |
void |
save(java.lang.String fileName)
Saves the property object to the specified location. |
void |
set(java.lang.String path,
java.lang.String value)
Sets the property value of the given path (key). |
| Methods inherited from class hk.hku.cecid.phoenix.common.util.Property |
getFromCache, load, load, loadFromFullPath, reload, reload, removeFromCache, saveToCache |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
fileName
protected java.lang.String fileName
- Internal variable for holding the file name of the property file
prop
protected java.util.Properties prop
- Internal variable for holding the Java build in Properties object
for manipulation
| Constructor Detail |
TextProperty
TextProperty(java.lang.String fileName) throws java.io.IOException
- Internal constructor. Not to be called by user. This loads the
content of the specified property file into memory.
TextProperty
public TextProperty()
- Default constructor. This is for creating a brand new text-based
property object.
| Method Detail |
getMultiple
public java.lang.String[] getMultiple(java.lang.String path)
- Gets the property value given the path (key). Not supported
for text based properties file.
- Specified by:
getMultiplein classProperty
get
public java.lang.String get(java.lang.String path)
get
public java.lang.String get(java.lang.String path, java.lang.String defaultValue)
- Gets the property value given the path (key). If the property value
is not found, the default value passed in is returned.
set
public void set(java.lang.String path, java.lang.String value)
save
public void save()
throws java.io.IOException
save
public void save(java.lang.String fileName) throws java.io.IOException
|
|||||||||
| Home >> All >> hk >> hku >> cecid >> phoenix >> common >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC