| java.util.Properties org.w3c.util.ObservableProperties
ObservableProperties | public class ObservableProperties extends Properties (Code) | | An enhanced property class that provides support to monitor changes.
This class extends the basic properties class of Java, by providing
monitoring support. It also provides more type conversion.
See Also: PropertyMonitoring |
Method Summary | |
public boolean | getBoolean(String name, boolean def) Get this property value, as a boolean.
Parameters: name - The name of the property to be fetched. Parameters: def - The default value, if the property isn't defined. | public double | getDouble(String name, double def) Get this property value, as a double.
Parameters: name - The name of the property. Parameters: def - The default value if undefined. | public File | getFile(String name, File def) Get this property value, as a File.
Parameters: name - The name of the property to be fetched. Parameters: def - The default value, if the property isn't defined. | public int | getInteger(String name, int def) Get this property value, as an integer.
Parameters: name - The name of the property to be fetched. Parameters: def - The default value, if the property isn't defined. | public long | getLong(String name, long def) | public String | getString(String name, String def) Get this property value, as a String.
Parameters: name - The name of the property to be fetched. Parameters: def - The default value, if the property isn't defined. | public String[] | getStringArray(String name, String def) Get this property as a String array.
By convention, properties that are get as string arrays should be
encoded as a | separated list of Strings.
Parameters: name - The property's name. Parameters: def - The default value (if undefined). | public synchronized boolean | putValue(String name, String value) Update a property value.
Assign a value to a property. | public synchronized void | registerObserver(PropertyMonitoring o) Subscribe for property monitoring. | public synchronized boolean | unregisterObserver(PropertyMonitoring o) Unsubscribe this object from the observers list.
Parameters: observer - The observer to unsubscribe. |
observers_count | int observers_count(Code) | | |
ObservableProperties | public ObservableProperties(Properties props)(Code) | | Build an httpdProperties instance from a Properties instance.
Parameters: props - The Properties instance. |
getBoolean | public boolean getBoolean(String name, boolean def)(Code) | | Get this property value, as a boolean.
Parameters: name - The name of the property to be fetched. Parameters: def - The default value, if the property isn't defined. A Boolean instance. |
getDouble | public double getDouble(String name, double def)(Code) | | Get this property value, as a double.
Parameters: name - The name of the property. Parameters: def - The default value if undefined. A double value. |
getFile | public File getFile(String name, File def)(Code) | | Get this property value, as a File.
Parameters: name - The name of the property to be fetched. Parameters: def - The default value, if the property isn't defined. An instance of File. |
getInteger | public int getInteger(String name, int def)(Code) | | Get this property value, as an integer.
Parameters: name - The name of the property to be fetched. Parameters: def - The default value, if the property isn't defined. An integer value. |
getString | public String getString(String name, String def)(Code) | | Get this property value, as a String.
Parameters: name - The name of the property to be fetched. Parameters: def - The default value, if the property isn't defined. An instance of String. |
getStringArray | public String[] getStringArray(String name, String def)(Code) | | Get this property as a String array.
By convention, properties that are get as string arrays should be
encoded as a | separated list of Strings.
Parameters: name - The property's name. Parameters: def - The default value (if undefined). A String array, or null if the propertyis undefined. |
putValue | public synchronized boolean putValue(String name, String value)(Code) | | Update a property value.
Assign a value to a property. If the property value has really changed
notify our observers of the change.
Parameters: name - The name of the property to assign. Parameters: value - The new value for this property, or nullif the property setting is to be cancelled. A boolean true if change was accepted by our observers, false otherwise. |
registerObserver | public synchronized void registerObserver(PropertyMonitoring o)(Code) | | Subscribe for property monitoring.
Parameters: observer - The object that handles the PropertyMonitoring interface. |
unregisterObserver | public synchronized boolean unregisterObserver(PropertyMonitoring o)(Code) | | Unsubscribe this object from the observers list.
Parameters: observer - The observer to unsubscribe. A boolean true if object was succesfully unsubscribed, false otherwise. |
|
|