Class AbstractStreamCommand

java.lang.Object
com.streamconverter.command.AbstractStreamCommand
All Implemented Interfaces:
IStreamCommand
Direct Known Subclasses:
CharacterConvertCommand, ConsumerCommand, CsvFilterCommand, CsvNavigateCommand, FileBufferCommand, JacocoXmlToModuleSlocCommand, JsonFilterCommand, JsonNavigateCommand, LineEndingNormalizeCommand, ModuleXmlConcatCommand, PmdXmlToViolationsCommand, SendHttpCommand, SlocAggregateCommand, SlocReportFormatCommand, XmlFilterCommand, XmlNavigateCommand

public abstract class AbstractStreamCommand extends Object implements IStreamCommand
Abstract class for stream commands.

This class provides a base for implementing IStreamCommand with a pre-configured logger. Subclasses implement execute(InputStream, OutputStream) directly.

  • Field Details

    • log

      protected final org.slf4j.Logger log
      Logger instance for this command. Uses the actual subclass name for better traceability.
  • Constructor Details

    • AbstractStreamCommand

      Default constructor.

      Initializes the command with default settings and creates a logger using the actual command class name.

  • Method Details

    • execute

      public abstract void execute(InputStream inputStream, OutputStream outputStream) throws IOException
      Executes the command on the provided input stream and writes the result to the output stream.
      Specified by:
      execute in interface IStreamCommand
      Parameters:
      inputStream - The input stream to read data from.
      outputStream - The output stream to write data to.
      Throws:
      IOException - If an I/O error occurs during the execution of the command.