Class CommentedProperties

All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>

public class CommentedProperties extends Properties
See Also:
  • Field Details Link icon

    • lineData Link icon

      public Vector<String> lineData
      Use a Vector to keep a copy of lines that are a comment or 'blank'
    • keyData Link icon

      public Vector<String> keyData
      Use a Vector to keep a copy of lines containing a key, i.e. they are a property.
  • Constructor Details Link icon

    • CommentedProperties Link icon

      public CommentedProperties()
  • Method Details Link icon

    • load Link icon

      public void load(InputStreamReader isr) throws IOException
      Load properties from the specified InputStreamReader. Overload the load method in Properties so we can keep comment and blank lines.
      Parameters:
      isr - The InputStreamReader to read.
      Throws:
      IOException
    • load Link icon

      public void load(InputStream inStream) throws IOException
      Load properties from the specified InputStream. Overload the load method in Properties so we can keep comment and blank lines.
      Overrides:
      load in class Properties
      Parameters:
      inStream - The InputStream to read.
      Throws:
      IOException
    • store Link icon

      public void store(OutputStream out, String header) throws IOException
      Overrides:
      store in class Properties
      Throws:
      IOException
    • store Link icon

      public void store(OutputStream out, String header, String encoding, Map<String,String> missing) throws IOException
      Throws:
      IOException
    • store Link icon

      public void store(OutputStream out, String header, String encoding) throws IOException
      Write the properties to the specified OutputStream.

      Overloads the store method in Properties so we can put back comment and blank lines.

      Parameters:
      out - The OutputStream to write to.
      header - Ignored, here for compatibility w/ Properties.
      encoding - The encoding of the file
      Throws:
      IOException - If the creation of the writer fails.
    • add Link icon

      public void add(String keyString, String value)
      Add a Property to the end of the CommentedProperties.
      Parameters:
      keyString - The Property key.
      value - The value of this Property.
    • addLine Link icon

      public void addLine(String line)
      Add a comment or blank line or comment to the end of the CommentedProperties.
      Parameters:
      line - The string to add to the end, make sure this is a comment or a 'whitespace' line.
    • clone Link icon

      public CommentedProperties clone()
      Overrides:
      clone in class Properties