Package org.apache.wiki.util

# Class CommentedProperties

java.lang.Object
java.util.Dictionary<K,V>
java.util.Hashtable<Object,Object>
java.util.Properties
org.apache.wiki.util.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
`void`
`load(InputStream inStream)`
`void`
`load(Reader in)`
Loads properties from a file opened by a supplied Reader.
`Object`
`put(Object arg0, Object arg1)`
`void`
`putAll(Map<?,?> arg0)`
`Object`
`remove(Object key)`
`Object`
`setProperty(String key, String value)`
`void`
`store(OutputStream out, String comments)`
`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

public CommentedProperties(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 Details

### load

public void load(InputStream inStream) throws IOException

Overrides:
  `load` in class `Properties`
Throws:
  `IOException`

### load

public void load(Reader in) throws IOException
Loads properties from a file opened by a supplied Reader.

Overrides:
  `load` in class `Properties`
Parameters:
  `in` - The reader to read properties from
Throws:
  `IOException` - in case something goes wrong.

### setProperty

public Object setProperty(String key, String value)

Overrides:
  `setProperty` in class `Properties`

### store

public void store(OutputStream out, String comments) throws IOException

Overrides:
  `store` in class `Properties`
Throws:
  `IOException`

### put

public Object put(Object arg0, Object arg1)

Specified by:
  `put` in interface `Map<Object,Object>`
Overrides:
  `put` in class `Properties`

### putAll

public void putAll(Map<?,?> arg0)

Specified by:
  `putAll` in interface `Map<Object,Object>`
Overrides:
  `putAll` in class `Properties`

### remove

public Object remove(Object key)

Specified by:
  `remove` in interface `Map<Object,Object>`
Overrides:
  `remove` in class `Properties`

### toString

public String toString()

Overrides:
  `toString` in class `Properties`