Package com.opengamma.strata.collect.io
Class IniFileOutput
- java.lang.Object
-
- com.opengamma.strata.collect.io.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IniFileOutput
standard(Appendable underlying)
Creates an instance, using the system default line separator and including additional whitespace around the '=' separator.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.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.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.void
writeIniFile(IniFile file)
Writes the provided file to the underlying.void
writeSection(String sectionName, PropertySet section)
Writes an individual section of an INI file to the underlying.
-
-
-
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 tonewLine
- 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 topadSeparatorWithWhitespace
- 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 topadSeparatorWithWhitespace
- if true, the key-value separator will be padded with whitespacenewLine
- 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 sectionsection
- 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
-
-