Class AbstractOutputFormatter

    • Constructor Detail

      • AbstractOutputFormatter

        public AbstractOutputFormatter()
    • Method Detail

      • canFormatOutput

        protected boolean canFormatOutput​(ExternalCommand command,
                                          boolean stdout)
        Determines whether the output should be formatted and forwarded to the command.
        Parameters:
        command - the command to forward the output to
        stdout - whether the output occurred on stdout
        Returns:
        true if to forward the output to the command
      • doFormatOutput

        protected abstract void doFormatOutput​(ExternalCommand command,
                                               boolean stdout,
                                               boolean blocking,
                                               String output)
        Formats the output received from the command. Feeds the formatted data back into the ExternalCommand instance.
        Parameters:
        command - the external command to feed the output back into
        stdout - whether the output was from stdout or stderr
        blocking - whether the output was received via blocking or async execution
        output - the output to format
      • formatOutput

        public void formatOutput​(ExternalCommand command,
                                 boolean stdout,
                                 boolean blocking,
                                 String output)
        Formats the output received from the command. Feeds the formatted data back into the ExternalCommand instance.
        Specified by:
        formatOutput in interface OutputFormatter
        Parameters:
        command - the external command to feed the output back into
        stdout - whether the output was from stdout or stderr
        blocking - whether the output was received via blocking or async execution
        output - the output to format
      • cleanUp

        public void cleanUp()
        Cleans up data structures, frees up memory.
        Specified by:
        cleanUp in interface CleanUpHandler