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
ExtendsProperties
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
-
-
Constructor Summary
Constructors Constructor Description CommentedProperties()
CommentedProperties(java.util.Properties defaultValues)
Creates new properties.
-
Method Summary
All Methods Instance Methods Concrete Methods 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
-
-
-
-
Constructor Detail
-
CommentedProperties
public CommentedProperties()
- See Also:
Properties()
-
CommentedProperties
public CommentedProperties(java.util.Properties defaultValues)
Creates new properties.- Parameters:
defaultValues
- A list of default values, which are used if in subsequent gets a key is not found.
-
-
Method Detail
-
load
public void load(java.io.InputStream inStream) throws java.io.IOException
- Overrides:
load
in classjava.util.Properties
- Throws:
java.io.IOException
-
load
public void load(java.io.Reader in) throws java.io.IOException
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
public java.lang.Object setProperty(java.lang.String key, java.lang.String value)
- Overrides:
setProperty
in classjava.util.Properties
-
store
public void store(java.io.OutputStream out, java.lang.String comments) throws java.io.IOException
- Overrides:
store
in classjava.util.Properties
- Throws:
java.io.IOException
-
put
public java.lang.Object put(java.lang.Object arg0, java.lang.Object arg1)
- Specified by:
put
in interfacejava.util.Map<java.lang.Object,java.lang.Object>
- Overrides:
put
in classjava.util.Properties
-
putAll
public void putAll(java.util.Map<?,?> arg0)
- Specified by:
putAll
in interfacejava.util.Map<java.lang.Object,java.lang.Object>
- Overrides:
putAll
in classjava.util.Properties
-
remove
public java.lang.Object remove(java.lang.Object key)
- Specified by:
remove
in interfacejava.util.Map<java.lang.Object,java.lang.Object>
- Overrides:
remove
in classjava.util.Properties
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.util.Properties
-
-