org.eigenbase.util.property
Class StringProperty

java.lang.Object
  extended by org.eigenbase.util.property.Property
      extended by org.eigenbase.util.property.StringProperty
Direct Known Subclasses:
PersistentStringProperty

public class StringProperty
extends Property

Definition and accessor for a string property.

Since:
May 4, 2004
Version:
$Id: //open/dt/dev/farrago/src/org/eigenbase/util/property/StringProperty.java#8 $
Author:
jhyde

Field Summary
 
Fields inherited from class org.eigenbase.util.property.Property
properties
 
Constructor Summary
StringProperty(java.util.Properties properties, java.lang.String path, java.lang.String defaultValue)
          Creates a string property.
 
Method Summary
 java.lang.String get()
          Retrieves the value of this property.
 java.lang.String get(boolean required)
          Retrieves the value of this property, optionally failing if there is no value.
 java.lang.String get(java.lang.String defaultValue)
          Retrieves the value of this property, or the default value if none is found.
 void set(java.lang.String value)
          Sets the value of this property.
 
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
 

Constructor Detail

StringProperty

public StringProperty(java.util.Properties properties,
                      java.lang.String path,
                      java.lang.String defaultValue)
Creates a 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.
Method Detail

get

public java.lang.String get()
Retrieves the value of this property. Returns the property's default value if the property set has no value for this property.


get

public java.lang.String get(boolean required)
Retrieves the value of this property, optionally failing if there is no value. Returns the property's default value if the property set has no value for this property.


get

public java.lang.String get(java.lang.String defaultValue)
Retrieves the value of this property, or the default value if none is found.


set

public void set(java.lang.String value)
Sets the value of this property.