Package org.apache.wiki.util
Class CommentedProperties
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<Object,
Object>
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:
-
Nested Class Summary
-
Field Summary
Fields inherited from class java.util.Properties
defaults
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
load
(InputStream inStream) void
Loads properties from a file opened by a supplied Reader.void
setProperty
(String key, String value) void
store
(OutputStream out, String comments) 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:
-
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
-