Package com.streamconverter.command
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
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 Summary
FieldsModifier and TypeFieldDescriptionprotected final org.slf4j.LoggerLogger instance for this command. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidexecute(InputStream inputStream, OutputStream outputStream) Executes the command on the provided input stream and writes the result to the output stream.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.streamconverter.command.IStreamCommand
commandName, withLogging, withLogging
-
Field Details
-
log
Logger instance for this command. Uses the actual subclass name for better traceability.
-
-
Constructor Details
-
AbstractStreamCommand
public AbstractStreamCommand()Default constructor.Initializes the command with default settings and creates a logger using the actual command class name.
-
-
Method Details
-
execute
Executes the command on the provided input stream and writes the result to the output stream.- Specified by:
executein interfaceIStreamCommand- 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.
-