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 voidload(InputStream inStream)voidload(Reader in)Loads properties from a file opened by a supplied Reader.Objectput(Object arg0, Object arg1)voidputAll(Map<?,?> arg0)Objectremove(Object key)ObjectsetProperty(String key, String value)voidstore(OutputStream out, String comments)StringtoString()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:
loadin classProperties- Throws:
IOException
-
load
Loads properties from a file opened by a supplied Reader.- Overrides:
loadin classProperties- Parameters:
in- The reader to read properties from- Throws:
IOException- in case something goes wrong.
-
setProperty
- Overrides:
setPropertyin classProperties
-
store
- Overrides:
storein classProperties- Throws:
IOException
-
put
-
putAll
-
remove
-
toString
- Overrides:
toStringin classProperties
-