org.eigenbase.util.property
Class PersistentStringProperty
java.lang.Object
org.eigenbase.util.property.Property
org.eigenbase.util.property.StringProperty
org.eigenbase.util.property.PersistentStringProperty
public class PersistentStringProperty
- extends StringProperty
Definition and accessor for a string property that is capable of storing
itself in a .properties
file.
- Since:
- December 3, 2004
- Version:
- $Id: //open/dev/farrago/src/org/eigenbase/util/property/PersistentStringProperty.java#13 $
- Author:
- Stephan Zuercher
Methods inherited from class org.eigenbase.util.property.Property |
addTrigger, booleanValue, getDefaultValue, getInternal, getPath, getString, isSet, onChange, removeTrigger, setString, stringValue, toBoolean |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
tracer
private static final Logger tracer
propertyFileLocation
private StringProperty propertyFileLocation
storage
private PersistentPropertyStorage storage
storageInitialized
private boolean storageInitialized
PersistentStringProperty
public PersistentStringProperty(Properties properties,
String path,
String defaultValue,
StringProperty propertyFileLocation)
- Creates a persistent string property.
- Parameters:
properties
- Properties object which holds values for this property.path
- Name by which this property is serialized to a properties
file, for example "com.acme.trace.Verbosity".defaultValue
- Default value, null if there is no default.propertyFileLocation
- Location of the property file where this
property's value should be persisted.
set
public String set(String value)
- Sets the value of this property.
This method is synchronized to prevent multiple threads from
attempting to initialize the property storage (
storage
)
simultaneously.
- Overrides:
set
in class StringProperty
- Returns:
- The previous value, or the default value if not set.