|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
The PropertiesFile interface represents a
Properties alike behavior for persistent properties
for a component, class or system, which needs persistent properties. Such
PropertiesFile implementation should consist of an internal file or stream based
association which is completely hidden to the outside. Users should only call
load() and save(String) to either load or store the
properties.
| Method Summary | |
void |
clear()
Clears the internal list of properties. |
java.lang.String |
getProperty(java.lang.String key)
Returns the property string previously associated to the parameter key. |
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Returns the property string previously associated to the parameter key. |
java.util.Set |
keySet()
Returns a set of keys. |
void |
load()
Loads properties from the stream it was previously associated with. |
java.lang.Object |
remove(java.lang.Object key)
Removes a key and corresponding value from this PropertiesFile. |
void |
save(java.lang.String header)
Writes the currently key-value pairs of this PropertiesFile instance out to internally set stream. |
java.lang.String |
setProperty(java.lang.String key,
java.lang.String value)
Maps the specified key to the specified value in this PropertiesFile. |
| Method Detail |
public void clear()
public void load()
throws java.io.IOException
java.io.IOException - if an error occurred when reading from the input
stream.public java.lang.String getProperty(java.lang.String key)
key. If no such property can be found null
is returned.
key - the key of a property.
key.
public java.lang.String getProperty(java.lang.String key,
java.lang.String defaultValue)
key. If no such property can be found
defaultValue is returned.
key - the key of a property.defaultValue - the value which should be returned if no value was
associated with the given key.
key.
public java.lang.String setProperty(java.lang.String key,
java.lang.String value)
null is returned. Otherwise the previously mapped value
is returned.
key - the key for the property.value - the value.
public java.lang.Object remove(java.lang.Object key)
key - the key that needs to be removed.
null if the key did not have a mapping.public java.util.Set keySet()
public void save(java.lang.String header)
throws java.io.IOException
header - the header to prepend to the key-value pairs. (optional)
java.io.IOException - if writing this property list to the specified output
stream throws an IOException.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||