|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Dictionary | +--java.util.Hashtable | +--java.util.Properties
Persistent properties class. This class is basically a hashtable that can be saved/loaded from a stream. If a property is not found, a property list containing defaults is searched. This allows arbitrary nesting.
Field Summary | |
protected Properties |
defaults
|
Constructor Summary | |
Properties()
Creates an empty property list. |
|
Properties(Properties defaults)
Creates an empty property list with specified defaults. |
Method Summary | |
String |
getProperty(String key)
Gets a property with the specified key. |
String |
getProperty(String key,
String defaultValue)
Gets a property with the specified key and default. |
void |
list(PrintStream out)
List properties, for debugging |
void |
load(InputStream in)
Loads properties from an InputStream. |
Enumeration |
propertyNames()
Enumerates all the keys. |
void |
save(OutputStream out,
String header)
Save properties to an OutputStream. |
Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, elements, get, isEmpty, keys, put, rehash, remove, size, toString |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Properties defaults
Constructor Detail |
public Properties()
public Properties(Properties defaults)
defaults
- the defaultsMethod Detail |
public void load(InputStream in) throws IOException
in
- the input stream
IOException
- Error when reading from input stream.public void save(OutputStream out, String header)
public String getProperty(String key)
key
- the hashtable keypublic String getProperty(String key, String defaultValue)
public Enumeration propertyNames()
public void list(PrintStream out)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |