Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.
public class Properties
ImplementsMap<Object, Object>
String keys and values, a second table of defaults behind them, and the
.properties text format.
The format is read as the JDK reads it: # and ! comments, =, : or
white space between key and value, a trailing backslash continuing a line
(the next line’s indentation dropped), and the escapes \t, \n, \r,
\f and backslash-u followed by four hexadecimal digits; a backslash
before any other character stands for that character. A stream is
ISO 8859-1; a reader is whatever its characters are. store writes text
that load reads back to the same table, escaping what the format
requires and, on a stream, every character outside printable ASCII.
The XML form (loadFromXML, storeToXML) and list are not provided.
Fields
protected Properties defaults | The table consulted for a key this one does not have, or null. |
Constructors
public Properties() | An empty table with no defaults. |
public Properties(Properties defaults) | An empty table with defaults behind it. |
Methods
Inherited nested types
Inherited methods
Field details
defaults
protected Properties defaultsConstructor details
Properties
public Properties()Properties
public Properties(Properties defaults)defaults behind it.Method details
getProperty
public String getProperty(String name)name here, else in the defaults, else null. A value
that is not a String counts as absent, as in the JDK.getProperty
public String getProperty(String name, String defaultValue)setProperty
public Object setProperty(String name, String value)name to value in this table, answering the value it replaced.load
public synchronized void load(InputStream in)
throws IOException.properties text, adding to what is here. The
stream is left open.Throws
load
public synchronized void load(Reader in)
throws IOException.properties text, adding to what is here. The reader is left
open.Throws
propertyNames
public Enumeration<?> propertyNames()stringPropertyNames
public Set<String> stringPropertyNames()save
public void save(OutputStream out, String comments)store(OutputStream, String).store(OutputStream, String) does, ignoring any
IOException.store
public void store(OutputStream out, String comments)
throws IOException.properties
text: the comment lines, a line with the current date, then one
key=value line per entry. The stream is flushed and left open.Throws
ClassCastException- if a key or value is not a
String IOException
store
public void store(Writer writer, String comments)
throws IOException.properties text, leaving characters outside
ASCII as they are. The writer is flushed and left open.Throws
ClassCastException- if a key or value is not a
String IOException