Class IniFileOutput


  • public final class IniFileOutput
    extends Object
    Outputs an INI formatted file.

    Provides a simple tool for writing an INI file.

    Instances of this class contain mutable state. A net instance must be created for each file to be output.

    • Method Detail

      • standard

        public static IniFileOutput standard​(Appendable underlying)
        Creates an instance, using the system default line separator and including additional whitespace around the '=' separator.
        Parameters:
        underlying - the destination to write to
        Returns:
        the INI outputter
      • standard

        public static IniFileOutput standard​(Appendable underlying,
                                             String newLine)
        Creates an instance, allowing the new line separator to be controlled and including additional whitespace around the '=' separator.
        Parameters:
        underlying - the destination to write to
        newLine - the destination to write to
        Returns:
        the INI outputter
      • standard

        public static IniFileOutput standard​(Appendable underlying,
                                             boolean padSeparatorWithWhitespace)
        Creates an instance, using the system default line separator and allowing the padding around the '=' separator to be controlled.
        Parameters:
        underlying - the destination to write to
        padSeparatorWithWhitespace - if true, the key-value separator will be padded with whitespace
        Returns:
        the INI outputter
      • standard

        public static IniFileOutput standard​(Appendable underlying,
                                             boolean padSeparatorWithWhitespace,
                                             String newLine)
        Creates an instance, allowing the new line separator and the padding around the '=' separator to be controlled.
        Parameters:
        underlying - the destination to write to
        padSeparatorWithWhitespace - if true, the key-value separator will be padded with whitespace
        newLine - the new line separator
        Returns:
        the INI outputter
      • writeSection

        public void writeSection​(String sectionName,
                                 PropertySet section)
        Writes an individual section of an INI file to the underlying.
        Parameters:
        sectionName - the name of the section
        section - the section whose contents to write
      • writeIniFile

        public void writeIniFile​(IniFile file)
        Writes the provided file to the underlying.
        Parameters:
        file - the file whose contents to write