public class CommentedProperties extends Properties
Properties
by providing support for comment
preservation. When the properties are written to disk, previous
comments present in the file are preserved.defaults
Constructor and Description |
---|
CommentedProperties() |
CommentedProperties(Properties defaultValues)
Creates new properties.
|
Modifier and Type | Method and Description |
---|---|
void |
load(InputStream inStream) |
void |
load(Reader in)
Loads properties from a file opened by a supplied Reader.
|
Object |
put(Object arg0,
Object arg1) |
void |
putAll(Map<?,?> arg0) |
Object |
remove(Object key) |
Object |
setProperty(String key,
String value) |
void |
store(OutputStream out,
String comments) |
String |
toString() |
getProperty, getProperty, list, list, loadFromXML, propertyNames, save, store, storeToXML, storeToXML, stringPropertyNames
clear, 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, values
public CommentedProperties()
Properties.Properties()
public CommentedProperties(Properties defaultValues)
defaultValues
- A list of default values, which are used if in subsequent gets
a key is not found.public void load(InputStream inStream) throws IOException
load
in class Properties
IOException
public void load(Reader in) throws IOException
load
in class Properties
in
- The reader to read properties fromIOException
- in case something goes wrong.public Object setProperty(String key, String value)
setProperty
in class Properties
public void store(OutputStream out, String comments) throws IOException
store
in class Properties
IOException
Copyright © 2001-2019 The Apache Software Foundation. All rights reserved.