org.apache.wiki.util
Class CommentedProperties

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<Object,Object>
          extended by java.util.Properties
              extended by 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
CommentedProperties()
           
CommentedProperties(Properties defaultValues)
          Creates new properties.
 
Method Summary
 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
getProperty, getProperty, list, list, loadFromXML, propertyNames, save, store, storeToXML, storeToXML, stringPropertyNames
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, rehash, size, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommentedProperties

public CommentedProperties()
See Also:
Properties.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 Detail

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 Hashtable<Object,Object>

putAll

public void putAll(Map arg0)

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

remove

public Object remove(Object key)

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

toString

public String toString()

Overrides:
toString in class Hashtable<Object,Object>


Copyright © {inceptionYear}-2014 The Apache Software Foundation. All rights reserved.