|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<String,String>
org.crosswire.common.util.PropertyMap
public class PropertyMap
for license details.
The copyright to this program is held by it's authors.,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
| Field Summary | |
|---|---|
private PropertyMap |
defaults
Default values for any keys not found in this property map. |
private static long |
serialVersionUID
The serialization id |
| Constructor Summary | |
|---|---|
PropertyMap()
Creates an empty property list with no default values. |
|
PropertyMap(PropertyMap defaults)
Creates an empty property map with the specified defaults. |
|
| Method Summary | |
|---|---|
String |
get(String key)
Searches for the property with the specified key in this property list. |
String |
get(String key,
String defaultValue)
Searches for the property with the specified key in this property list. |
String |
getProperty(String key)
Deprecated. use @get(String) instead |
String |
getProperty(String key,
String defaultValue)
Deprecated. use get(String, String) instead |
void |
load(InputStream inStream)
Reads a property list (key and element pairs) from the input byte stream. |
String |
setProperty(String key,
String value)
Deprecated. use #put(String, String) instead |
void |
store(OutputStream out,
String comments)
Writes this property list (key and element pairs) in this PropertyMap table to the output stream in a format suitable
for loading into a PropertyMap table using the
load(InputStream) method. |
| Methods inherited from class java.util.LinkedHashMap |
|---|
clear, containsValue, get, removeEldestEntry |
| Methods inherited from class java.util.HashMap |
|---|
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values |
| Methods inherited from class java.util.AbstractMap |
|---|
equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
| Field Detail |
|---|
private PropertyMap defaults
private static final long serialVersionUID
| Constructor Detail |
|---|
public PropertyMap()
public PropertyMap(PropertyMap defaults)
defaults - the defaults.| Method Detail |
|---|
public String get(String key)
null if the property is not found.
key - the lookup key.
Properties,
defaults
public String get(String key,
String defaultValue)
key - the lookup key.defaultValue - a default value.
Properties,
defaults
@Deprecated
public String setProperty(String key,
String value)
#put(String, String) instead
#put(String, String), provided as
a simple way to migrate from Properties.
key - the key to be placed into this property list.value - the value corresponding to key.
null if it did not have one.@Deprecated public String getProperty(String key)
@get(String) instead
get(String), provided as
a simple way to migrate from Properties.
key - the lookup key
@Deprecated
public String getProperty(String key,
String defaultValue)
get(String, String) instead
get(String, String), provided as
a simple way to migrate from Properties.
key - the lookup key.defaultValue - a default value.
public void load(InputStream inStream)
throws IOException
load(InputStream) and is assumed to use
the ISO 8859-1 character encoding; that is each byte is one Latin1
character. Characters not in Latin1, and certain special characters,
are represented in keys and elements using
Unicode escapes.
The specified stream remains open after this method returns.
inStream - the input stream.
IOException - if an error occurred when reading from the
input stream.
IllegalArgumentException - if the input stream contains a
malformed Unicode escape sequence.
public void store(OutputStream out,
String comments)
throws IOException
PropertyMap table to the output stream in a format suitable
for loading into a PropertyMap table using the
load(InputStream) method.
Properties from the defaults table of this PropertyMap
table (if any) are not written out by this method.
This method outputs the comments, properties keys and values in
the same format as specified in
store(Writer),
After the entries have been written, the output stream is flushed. The output stream remains open after this method returns.
out - an output stream.comments - a description of the property list.
IOException - if writing this property list to the specified
output stream throws an IOException.
NullPointerException - if out is null.
|
Copyright ? 2003-2011 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||