Package org.apache.wiki.util
Class CommentedProperties
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<Object,Object>
public class CommentedProperties extends Properties
Extends
Properties
by providing support for comment
preservation. When the properties are written to disk, previous
comments present in the file are preserved.- Since:
- 2.4.22
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class java.util.Properties
defaults
-
Constructor Summary
Constructors Constructor Description CommentedProperties()
CommentedProperties(Properties defaultValues)
Creates new properties. -
Method Summary
Modifier and Type Method 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()
Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, getProperty, hashCode, isEmpty, keys, keySet, list, list, loadFromXML, merge, propertyNames, putIfAbsent, rehash, remove, replace, replace, replaceAll, save, size, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, values
-
Constructor Details
-
CommentedProperties
public CommentedProperties()- See Also:
Properties()
-
CommentedProperties
Creates new properties.- Parameters:
defaultValues
- A list of default values, which are used if in subsequent gets a key is not found.
-
-
Method Details
-
load
- Overrides:
load
in classProperties
- Throws:
IOException
-
load
Loads properties from a file opened by a supplied Reader.- Overrides:
load
in classProperties
- Parameters:
in
- The reader to read properties from- Throws:
IOException
- in case something goes wrong.
-
setProperty
- Overrides:
setProperty
in classProperties
-
store
- Overrides:
store
in classProperties
- Throws:
IOException
-
put
-
putAll
-
remove
-
toString
- Overrides:
toString
in classProperties
-