< prev index next >

src/java.base/share/classes/java/util/Properties.java

Print this page

        

*** 58,73 **** * the call to the {@code propertyNames} or {@code list} method * will fail if it is called on a "compromised" {@code Properties} * object that contains a non-{@code String} key. * * <p> ! * The {@link #load(java.io.Reader) load(Reader)} <tt>/</tt> * {@link #store(java.io.Writer, java.lang.String) store(Writer, String)} * methods load and store properties from and to a character based stream * in a simple line-oriented format specified below. * ! * The {@link #load(java.io.InputStream) load(InputStream)} <tt>/</tt> * {@link #store(java.io.OutputStream, java.lang.String) store(OutputStream, String)} * methods work the same way as the load(Reader)/store(Writer, String) pair, except * the input/output stream is encoded in ISO 8859-1 character encoding. * Characters that cannot be directly represented in this encoding can be written using * Unicode escapes as defined in section 3.3 of --- 58,73 ---- * the call to the {@code propertyNames} or {@code list} method * will fail if it is called on a "compromised" {@code Properties} * object that contains a non-{@code String} key. * * <p> ! * The {@link #load(java.io.Reader) load(Reader)} {@code /} * {@link #store(java.io.Writer, java.lang.String) store(Writer, String)} * methods load and store properties from and to a character based stream * in a simple line-oriented format specified below. * ! * The {@link #load(java.io.InputStream) load(InputStream)} {@code /} * {@link #store(java.io.OutputStream, java.lang.String) store(OutputStream, String)} * methods work the same way as the load(Reader)/store(Writer, String) pair, except * the input/output stream is encoded in ISO 8859-1 character encoding. * Characters that cannot be directly represented in this encoding can be written using * Unicode escapes as defined in section 3.3 of
*** 103,113 **** * * &lt;!ATTLIST entry key CDATA #REQUIRED&gt; * </pre> * * <p>This class is thread-safe: multiple threads can share a single ! * <tt>Properties</tt> object without the need for external synchronization. * * @author Arthur van Hoff * @author Michael McCloskey * @author Xueming Shen * @since 1.0 --- 103,113 ---- * * &lt;!ATTLIST entry key CDATA #REQUIRED&gt; * </pre> * * <p>This class is thread-safe: multiple threads can share a single ! * {@code Properties} object without the need for external synchronization. * * @author Arthur van Hoff * @author Michael McCloskey * @author Xueming Shen * @since 1.0
*** 142,158 **** public Properties(Properties defaults) { this.defaults = defaults; } /** ! * Calls the <tt>Hashtable</tt> method {@code put}. Provided for ! * parallelism with the <tt>getProperty</tt> method. Enforces use of * strings for property keys and values. The value returned is the ! * result of the <tt>Hashtable</tt> call to {@code put}. * * @param key the key to be placed into this property list. ! * @param value the value corresponding to <tt>key</tt>. * @return the previous value of the specified key in this property * list, or {@code null} if it did not have one. * @see #getProperty * @since 1.2 */ --- 142,158 ---- public Properties(Properties defaults) { this.defaults = defaults; } /** ! * Calls the {@code Hashtable} method {@code put}. Provided for ! * parallelism with the {@code getProperty} method. Enforces use of * strings for property keys and values. The value returned is the ! * result of the {@code Hashtable} call to {@code put}. * * @param key the key to be placed into this property list. ! * @param value the value corresponding to {@code key}. * @return the previous value of the specified key in this property * list, or {@code null} if it did not have one. * @see #getProperty * @since 1.2 */
*** 754,764 **** * The output stream remains open after this method returns. * * @param writer an output character stream writer. * @param comments a description of the property list. * @exception IOException if writing this property list to the specified ! * output stream throws an <tt>IOException</tt>. * @exception ClassCastException if this {@code Properties} object * contains any keys or values that are not {@code Strings}. * @exception NullPointerException if {@code writer} is null. * @since 1.6 */ --- 754,764 ---- * The output stream remains open after this method returns. * * @param writer an output character stream writer. * @param comments a description of the property list. * @exception IOException if writing this property list to the specified ! * output stream throws an {@code IOException}. * @exception ClassCastException if this {@code Properties} object * contains any keys or values that are not {@code Strings}. * @exception NullPointerException if {@code writer} is null. * @since 1.6 */
*** 801,811 **** * The output stream remains open after this method returns. * * @param out an output stream. * @param comments a description of the property list. * @exception IOException if writing this property list to the specified ! * output stream throws an <tt>IOException</tt>. * @exception ClassCastException if this {@code Properties} object * contains any keys or values that are not {@code Strings}. * @exception NullPointerException if {@code out} is null. * @since 1.2 */ --- 801,811 ---- * The output stream remains open after this method returns. * * @param out an output stream. * @param comments a description of the property list. * @exception IOException if writing this property list to the specified ! * output stream throws an {@code IOException}. * @exception ClassCastException if this {@code Properties} object * contains any keys or values that are not {@code Strings}. * @exception NullPointerException if {@code out} is null. * @since 1.2 */
*** 858,868 **** * * <p>The specified stream is closed after this method returns. * * @param in the input stream from which to read the XML document. * @throws IOException if reading from the specified input stream ! * results in an <tt>IOException</tt>. * @throws java.io.UnsupportedEncodingException if the document's encoding * declaration can be read and it specifies an encoding that is not * supported * @throws InvalidPropertiesFormatException Data on input stream does not * constitute a valid XML document with the mandated document type. --- 858,868 ---- * * <p>The specified stream is closed after this method returns. * * @param in the input stream from which to read the XML document. * @throws IOException if reading from the specified input stream ! * results in an {@code IOException}. * @throws java.io.UnsupportedEncodingException if the document's encoding * declaration can be read and it specifies an encoding that is not * supported * @throws InvalidPropertiesFormatException Data on input stream does not * constitute a valid XML document with the mandated document type.
*** 883,901 **** /** * Emits an XML document representing all of the properties contained * in this table. * ! * <p> An invocation of this method of the form <tt>props.storeToXML(os, ! * comment)</tt> behaves in exactly the same way as the invocation ! * <tt>props.storeToXML(os, comment, "UTF-8");</tt>. * * @param os the output stream on which to emit the XML document. * @param comment a description of the property list, or {@code null} * if no comment is desired. * @throws IOException if writing to the specified output stream ! * results in an <tt>IOException</tt>. * @throws NullPointerException if {@code os} is null. * @throws ClassCastException if this {@code Properties} object * contains any keys or values that are not * {@code Strings}. * @see #loadFromXML(InputStream) --- 883,901 ---- /** * Emits an XML document representing all of the properties contained * in this table. * ! * <p> An invocation of this method of the form {@code props.storeToXML(os, ! * comment)} behaves in exactly the same way as the invocation ! * {@code props.storeToXML(os, comment, "UTF-8");}. * * @param os the output stream on which to emit the XML document. * @param comment a description of the property list, or {@code null} * if no comment is desired. * @throws IOException if writing to the specified output stream ! * results in an {@code IOException}. * @throws NullPointerException if {@code os} is null. * @throws ClassCastException if this {@code Properties} object * contains any keys or values that are not * {@code Strings}. * @see #loadFromXML(InputStream)
*** 931,941 **** * @param encoding the name of a supported * <a href="../lang/package-summary.html#charenc"> * character encoding</a> * * @throws IOException if writing to the specified output stream ! * results in an <tt>IOException</tt>. * @throws java.io.UnsupportedEncodingException if the encoding is not * supported by the implementation. * @throws NullPointerException if {@code os} is {@code null}, * or if {@code encoding} is {@code null}. * @throws ClassCastException if this {@code Properties} object --- 931,941 ---- * @param encoding the name of a supported * <a href="../lang/package-summary.html#charenc"> * character encoding</a> * * @throws IOException if writing to the specified output stream ! * results in an {@code IOException}. * @throws java.io.UnsupportedEncodingException if the encoding is not * supported by the implementation. * @throws NullPointerException if {@code os} is {@code null}, * or if {@code encoding} is {@code null}. * @throws ClassCastException if this {@code Properties} object
*** 1014,1027 **** * Returns a set of keys in this property list where * the key and its corresponding value are strings, * including distinct keys in the default property list if a key * of the same name has not already been found from the main * properties list. Properties whose key or value is not ! * of type <tt>String</tt> are omitted. * <p> ! * The returned set is not backed by the <tt>Properties</tt> object. ! * Changes to this <tt>Properties</tt> are not reflected in the set, * or vice versa. * * @return a set of keys in this property list where * the key and its corresponding value are strings, * including the keys in the default property list. --- 1014,1027 ---- * Returns a set of keys in this property list where * the key and its corresponding value are strings, * including distinct keys in the default property list if a key * of the same name has not already been found from the main * properties list. Properties whose key or value is not ! * of type {@code String} are omitted. * <p> ! * The returned set is not backed by the {@code Properties} object. ! * Changes to this {@code Properties} are not reflected in the set, * or vice versa. * * @return a set of keys in this property list where * the key and its corresponding value are strings, * including the keys in the default property list.
< prev index next >