|
Final | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.util.Dictionary<K,V>
java.util.Hashtable<Object,Object>
java.util.Properties
public class Properties
Properties is a Hashtable where the keys and values must be Strings. Each Properties can have a default Properties which specifies the default values which are used if the key is not in this Properties.
Hashtable,
System.getProperties(),
Serialized Form| Field Summary | |
|---|---|
protected Properties |
defaults
The default values for this Properties. |
| Constructor Summary | |
|---|---|
Properties()
Constructs a new Properties object. |
|
Properties(Properties properties)
Constructs a new Properties object using the specified default properties. |
|
| Method Summary | |
|---|---|
String |
getProperty(String name)
Searches for the property with the specified name. |
String |
getProperty(String name,
String defaultValue)
Searches for the property with the specified name. |
void |
list(PrintStream out)
Lists the mappings in this Properties to the specified PrintStream in a human readable form. |
void |
list(PrintWriter writer)
Lists the mappings in this Properties to the specified PrintWriter in a human readable form. |
void |
load(InputStream in)
Loads properties from the specified InputStream. |
Enumeration<?> |
propertyNames()
Answers all of the property names that this Properties contains. |
void |
save(OutputStream out,
String comment)
Deprecated. Does not throw an IOException, use store() |
Object |
setProperty(String name,
String value)
Maps the specified key to the specified value. |
void |
store(OutputStream out,
String comment)
Stores the mappings in this Properties to the specified OutputStream, putting the specified comment at the beginning. |
| Methods inherited from class java.util.Hashtable |
|---|
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Properties defaults
| Constructor Detail |
|---|
public Properties()
public Properties(Properties properties)
properties - the default properties| Method Detail |
|---|
public String getProperty(String name)
name - the name of the property to find
public String getProperty(String name,
String defaultValue)
name - the name of the property to finddefaultValue - the default value
public void list(PrintStream out)
out - the PrintStreampublic void list(PrintWriter writer)
writer - the PrintWriterpublic void load(InputStream in)
throws IOException
key=value, one property per line.
in - the input stream
IOException - if I/O error occurspublic Enumeration<?> propertyNames()
@Deprecated
public void save(OutputStream out,
String comment)
out - the OutputStreamcomment - the comment
ClassCastException - when the key or value of a mapping is
not a Stringpublic Object setProperty(String name,
String value)
name - the keyvalue - the value
public void store(OutputStream out,
String comment)
throws IOException
out - the OutputStreamcomment - the comment
ClassCastException - when the key or value of a mapping is
not a String
IOException - if I/O error occurs
|
Final | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||