Class OutputFile

java.lang.Object
com.mackenziehigh.sexpr.util.OutputFile

public final class OutputFile extends Object
An instance of this class represents a output text file. This class is useful when using schemas to perform code generation. The file will be encoded using (UTF-8).
  • Constructor Details

    • OutputFile

      public OutputFile(File file, int capacity, int step)
      Sole Constructor.
      Parameters:
      file - is the value for file().
      capacity - is the expected capacity of the output string.
      step - is the number of spaces per indentation level.
  • Method Details

    • file

      public File file()
      This method retrieves the path to where the output file will be written.
      Returns:
      the path to the output file.
    • content

      public StringPrinter content()
      This method retrieve the object used to generate the formatted file content.
      Returns:
      the content of the output file.
    • write

      public void write() throws IOException
      Use this method to write the output file to disk.
      Throws:
      IOException - if the file cannot be written.
    • toString

      public String toString()
      Overrides:
      toString in class Object