public class CommentedProperties extends java.util.Properties
Properties by providing support for comment
preservation. When the properties are written to disk, previous
comments present in the file are preserved.| Constructor and Description |
|---|
CommentedProperties() |
CommentedProperties(java.util.Properties defaultValues)
Creates new properties.
|
| Modifier and Type | Method and Description |
|---|---|
void |
load(java.io.InputStream inStream) |
void |
load(java.io.Reader in)
Loads properties from a file opened by a supplied Reader.
|
java.lang.Object |
put(java.lang.Object arg0,
java.lang.Object arg1) |
void |
putAll(java.util.Map<?,?> arg0) |
java.lang.Object |
remove(java.lang.Object key) |
java.lang.Object |
setProperty(java.lang.String key,
java.lang.String value) |
void |
store(java.io.OutputStream out,
java.lang.String comments) |
java.lang.String |
toString() |
getProperty, getProperty, list, list, loadFromXML, propertyNames, save, store, storeToXML, storeToXML, stringPropertyNamesclear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keys, keySet, merge, putIfAbsent, rehash, remove, replace, replace, replaceAll, size, valuespublic CommentedProperties()
Properties.Properties()public CommentedProperties(java.util.Properties defaultValues)
defaultValues - A list of default values, which are used if in subsequent gets
a key is not found.public void load(java.io.InputStream inStream) throws java.io.IOException
load in class java.util.Propertiesjava.io.IOExceptionpublic void load(java.io.Reader in) throws java.io.IOException
load in class java.util.Propertiesin - The reader to read properties fromjava.io.IOException - in case something goes wrong.public java.lang.Object setProperty(java.lang.String key, java.lang.String value)
setProperty in class java.util.Propertiespublic void store(java.io.OutputStream out, java.lang.String comments) throws java.io.IOException
store in class java.util.Propertiesjava.io.IOExceptionpublic java.lang.Object put(java.lang.Object arg0, java.lang.Object arg1)
put in interface java.util.Map<java.lang.Object,java.lang.Object>put in class java.util.Hashtable<java.lang.Object,java.lang.Object>public void putAll(java.util.Map<?,?> arg0)
putAll in interface java.util.Map<java.lang.Object,java.lang.Object>putAll in class java.util.Hashtable<java.lang.Object,java.lang.Object>public java.lang.Object remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Object,java.lang.Object>remove in class java.util.Hashtable<java.lang.Object,java.lang.Object>public java.lang.String toString()
toString in class java.util.Hashtable<java.lang.Object,java.lang.Object>Copyright (c) 2001-2022 The Apache Software Foundation. All rights reserved.