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 void
load(java.io.InputStream inStream)
void
load(java.io.Reader in)
Loads properties from a file opened by a supplied Reader.java.lang.Object
put(java.lang.Object arg0, java.lang.Object arg1)
void
putAll(java.util.Map<?,?> arg0)
java.lang.Object
remove(java.lang.Object key)
java.lang.Object
setProperty(java.lang.String key, java.lang.String value)
void
store(java.io.OutputStream out, java.lang.String comments)
java.lang.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
Methods 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:
load
in classjava.util.Properties
- Throws:
java.io.IOException
-
load
Loads properties from a file opened by a supplied Reader.- Overrides:
load
in classjava.util.Properties
- Parameters:
in
- The reader to read properties from- Throws:
java.io.IOException
- in case something goes wrong.
-
setProperty
- Overrides:
setProperty
in classjava.util.Properties
-
store
- Overrides:
store
in classjava.util.Properties
- Throws:
java.io.IOException
-
put
- Specified by:
put
in interfacejava.util.Map<java.lang.Object,java.lang.Object>
- Overrides:
put
in classjava.util.Properties
-
putAll
- Specified by:
putAll
in interfacejava.util.Map<java.lang.Object,java.lang.Object>
- Overrides:
putAll
in classjava.util.Properties
-
remove
- Specified by:
remove
in interfacejava.util.Map<java.lang.Object,java.lang.Object>
- Overrides:
remove
in classjava.util.Properties
-
toString
- Overrides:
toString
in classjava.util.Properties
-