Class 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
    • 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
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • 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 class java.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 class java.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 class java.util.Properties
      • store

        public void store​(java.io.OutputStream out,
                          java.lang.String comments)
                   throws java.io.IOException
        Overrides:
        store in class java.util.Properties
        Throws:
        java.io.IOException
      • put

        public java.lang.Object put​(java.lang.Object arg0,
                                    java.lang.Object arg1)
        Specified by:
        put in interface java.util.Map<java.lang.Object,​java.lang.Object>
        Overrides:
        put in class java.util.Properties
      • putAll

        public void putAll​(java.util.Map<?,​?> arg0)
        Specified by:
        putAll in interface java.util.Map<java.lang.Object,​java.lang.Object>
        Overrides:
        putAll in class java.util.Properties
      • remove

        public java.lang.Object remove​(java.lang.Object key)
        Specified by:
        remove in interface java.util.Map<java.lang.Object,​java.lang.Object>
        Overrides:
        remove in class java.util.Properties
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.util.Properties