Package org.apache.wiki.util
Class CommentedProperties
java.lang.Object
java.util.Dictionary<K,V>
java.util.Hashtable<java.lang.Object,java.lang.Object>
java.util.Properties
org.apache.wiki.util.CommentedProperties
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.util.Map<java.lang.Object,java.lang.Object>
public class CommentedProperties extends java.util.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(java.util.Properties defaultValues)Creates new properties. -
Method Summary
Modifier and Type Method Description voidload(java.io.InputStream inStream)voidload(java.io.Reader in)Loads properties from a file opened by a supplied Reader.java.lang.Objectput(java.lang.Object arg0, java.lang.Object arg1)voidputAll(java.util.Map<?,?> arg0)java.lang.Objectremove(java.lang.Object key)java.lang.ObjectsetProperty(java.lang.String key, java.lang.String value)voidstore(java.io.OutputStream out, java.lang.String comments)java.lang.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, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
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 classjava.util.Properties- Throws:
java.io.IOException
-
load
Loads properties from a file opened by a supplied Reader.- Overrides:
loadin classjava.util.Properties- Parameters:
in- The reader to read properties from- Throws:
java.io.IOException- in case something goes wrong.
-
setProperty
- Overrides:
setPropertyin classjava.util.Properties
-
store
- Overrides:
storein classjava.util.Properties- Throws:
java.io.IOException
-
put
- Specified by:
putin interfacejava.util.Map<java.lang.Object,java.lang.Object>- Overrides:
putin classjava.util.Properties
-
putAll
- Specified by:
putAllin interfacejava.util.Map<java.lang.Object,java.lang.Object>- Overrides:
putAllin classjava.util.Properties
-
remove
- Specified by:
removein interfacejava.util.Map<java.lang.Object,java.lang.Object>- Overrides:
removein classjava.util.Properties
-
toString
- Overrides:
toStringin classjava.util.Properties
-