📄 properties.html
字号:
Prints this property list out to the specified output stream.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/Properties.html#load(java.io.InputStream)">load</A></B>(<A HREF="../../java/io/InputStream.html">InputStream</A> inStream)</CODE><BR> Reads a property list (key and element pairs) from the input stream.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/util/Enumeration.html">Enumeration</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/Properties.html#propertyNames()">propertyNames</A></B>()</CODE><BR> Returns an enumeration of all the keys in this property list, including the keys in the default property list.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/Properties.html#save(java.io.OutputStream, java.lang.String)">save</A></B>(<A HREF="../../java/io/OutputStream.html">OutputStream</A> out, <A HREF="../../java/lang/String.html">String</A> header)</CODE><BR> <B>Deprecated.</B> <I>This method does not throw an IOException if an I/O error occurs while saving the property list. As of the Java 2 platform v1.2, the preferred way to save a properties list is via the <code>store(OutputStream out, String header)</code> method.</I></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/Properties.html#setProperty(java.lang.String, java.lang.String)">setProperty</A></B>(<A HREF="../../java/lang/String.html">String</A> key, <A HREF="../../java/lang/String.html">String</A> value)</CODE><BR> Calls the hashtable method <code>put</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/Properties.html#store(java.io.OutputStream, java.lang.String)">store</A></B>(<A HREF="../../java/io/OutputStream.html">OutputStream</A> out, <A HREF="../../java/lang/String.html">String</A> header)</CODE><BR> Writes this property list (key and element pairs) in this <code>Properties</code> table to the output stream in a format suitable for loading into a <code>Properties</code> table using the <code>load</code> method.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.util.Hashtable"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.util.<A HREF="../../java/util/Hashtable.html">Hashtable</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/util/Hashtable.html#clear()">clear</A>, <A HREF="../../java/util/Hashtable.html#clone()">clone</A>, <A HREF="../../java/util/Hashtable.html#contains(java.lang.Object)">contains</A>, <A HREF="../../java/util/Hashtable.html#containsKey(java.lang.Object)">containsKey</A>, <A HREF="../../java/util/Hashtable.html#containsValue(java.lang.Object)">containsValue</A>, <A HREF="../../java/util/Hashtable.html#elements()">elements</A>, <A HREF="../../java/util/Hashtable.html#entrySet()">entrySet</A>, <A HREF="../../java/util/Hashtable.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/util/Hashtable.html#get(java.lang.Object)">get</A>, <A HREF="../../java/util/Hashtable.html#hashCode()">hashCode</A>, <A HREF="../../java/util/Hashtable.html#isEmpty()">isEmpty</A>, <A HREF="../../java/util/Hashtable.html#keys()">keys</A>, <A HREF="../../java/util/Hashtable.html#keySet()">keySet</A>, <A HREF="../../java/util/Hashtable.html#put(java.lang.Object, java.lang.Object)">put</A>, <A HREF="../../java/util/Hashtable.html#putAll(java.util.Map)">putAll</A>, <A HREF="../../java/util/Hashtable.html#rehash()">rehash</A>, <A HREF="../../java/util/Hashtable.html#remove(java.lang.Object)">remove</A>, <A HREF="../../java/util/Hashtable.html#size()">size</A>, <A HREF="../../java/util/Hashtable.html#toString()">toString</A>, <A HREF="../../java/util/Hashtable.html#values()">values</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="defaults"><!-- --></A><H3>defaults</H3><PRE>protected <A HREF="../../java/util/Properties.html">Properties</A> <B>defaults</B></PRE><DL><DD>A property list that contains default values for any keys not found in this property list.</DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="Properties()"><!-- --></A><H3>Properties</H3><PRE>public <B>Properties</B>()</PRE><DL><DD>Creates an empty property list with no default values.</DL><HR><A NAME="Properties(java.util.Properties)"><!-- --></A><H3>Properties</H3><PRE>public <B>Properties</B>(<A HREF="../../java/util/Properties.html">Properties</A> defaults)</PRE><DL><DD>Creates an empty property list with the specified defaults.<DD><DL><DT><B>Parameters:</B><DD><CODE>defaults</CODE> - the defaults.</DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="setProperty(java.lang.String, java.lang.String)"><!-- --></A><H3>setProperty</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>setProperty</B>(<A HREF="../../java/lang/String.html">String</A> key, <A HREF="../../java/lang/String.html">String</A> value)</PRE><DL><DD>Calls the hashtable method <code>put</code>. Provided for parallelism with the <tt>getProperty</tt> method. Enforces use of strings for property keys and values.<DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - the key to be placed into this property list.<DD><CODE>value</CODE> - the value corresponding to <tt>key</tt>.<DT><B>Since: </B><DD>1.2</DD><DT><B>See Also: </B><DD><A HREF="../../java/util/Properties.html#getProperty(java.lang.String)"><CODE>getProperty(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="load(java.io.InputStream)"><!-- --></A><H3>load</H3><PRE>public void <B>load</B>(<A HREF="../../java/io/InputStream.html">InputStream</A> inStream) throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Reads a property list (key and element pairs) from the input stream. The stream is assumed to be using the ISO 8859-1 character encoding. <p> Every property occupies one line of the input stream. Each line is terminated by a line terminator (<code>\n</code> or <code>\r</code> or <code>\r\n</code>). Lines from the input stream are processed until end of file is reached on the input stream. <p> A line that contains only whitespace or whose first non-whitespace character is an ASCII <code>#</code> or <code>!</code> is ignored (thus, <code>#</code> or <code>!</code> indicate comment lines). <p> Every line other than a blank line or a comment line describes one property to be added to the table (except that if a line ends with \, then the following line, if it exists, is treated as a continuation line, as described below). The key consists of all the characters in the line starting with the first non-whitespace character and up to, but not including, the first ASCII <code>=</code>, <code>:</code>, or whitespace character. All of the key termination characters may be included in the key by preceding them with a \. Any whitespace after the key is skipped; if the first non-whitespace character after the key is <code>=</code> or <code>:</code>, then it is ignored and any whitespace characters after it are also skipped. All remaining characters on the line become part of the associated element string. Within the element string, the ASCII escape sequences <code>\t</code>, <code>\n</code>, <code>\r</code>, <code>\\</code>, <code>\"</code>, <code>\'</code>, <code>\  </code>  (a backslash and a space), and <code>\u</code><i>xxxx</i> are recognized and converted to single characters. Moreover, if the last character on the line is <code>\</code>, then the next line is treated as a continuation of the current line; the <code>\</code> and line terminator are simply discarded, and any leading whitespace characters on the continuation line are also discarded and are not part of the element string. <p> As an example, each of the following four lines specifies the key <code>"Truth"</code> and the associated element value <code>"Beauty"</code>: <p> <pre> Truth = Beauty Truth:Beauty Truth :Beauty </pre> As another example, the following three lines specify a single property: <p> <pre> fruits apple, banana, pear, \ cantaloupe, watermelon, \ kiwi, mango </pre> The key is <code>"fruits"</code> and the associated element is: <p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -