|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ix.util.PropertyLogger
public class PropertyLogger
Automatically log property values to a file. The property, object, and property-value must all be strings.
Nested Class Summary | |
---|---|
class |
PropertyLogger.LoggingMap
A Map-like object that records any property value that is given to its 'put' method. |
Constructor Summary | |
---|---|
PropertyLogger(java.lang.String logFileName)
Make a logger for the named file. |
Method Summary | |
---|---|
PropertyLogger.LoggingMap |
ensureMap(java.lang.String propName)
Returns this logger's LoggingMap for the named property, creating it if it does not already exist. |
java.lang.String |
get(java.lang.String propName,
java.lang.String objectName)
Returns the object's value of the named property, or else else if no such value has been assigned. |
PropertyLogger.LoggingMap |
getMap(java.lang.String propName)
Returns this logger's LoggingMap for the named property, or else null of no such map yet exists. |
static void |
main(java.lang.String[] argv)
Simple main program for testing. |
void |
put(java.lang.String propName,
java.lang.String objectName,
java.lang.String propValue)
Records a value for the named object and property. |
boolean |
putIfNew(java.lang.String propName,
java.lang.String objectName,
java.lang.String propValue)
Records a value for the named object and property, but only if the value is new. |
void |
readLogIfExists()
Reads and remembers property values from this logger's log file if the file exists. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyLogger(java.lang.String logFileName)
Method Detail |
---|
public PropertyLogger.LoggingMap getMap(java.lang.String propName)
public PropertyLogger.LoggingMap ensureMap(java.lang.String propName)
public java.lang.String get(java.lang.String propName, java.lang.String objectName)
public void put(java.lang.String propName, java.lang.String objectName, java.lang.String propValue)
readLogIfExists()
will be recorded in the new file, followed by the new
property value.
public boolean putIfNew(java.lang.String propName, java.lang.String objectName, java.lang.String propValue)
put(String,String,String)
.
public void readLogIfExists()
When the first new property value is assigned, the file will be renamed (if it exists), and a new file will be created. The old property values (if any), plus the new value, will then be written to the new file.
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |