Package com.streamconverter.command
Class AbstractStreamCommand
java.lang.Object
com.streamconverter.command.AbstractStreamCommand
- All Implemented Interfaces:
IStreamCommand
- Direct Known Subclasses:
CharacterConvertCommand
,ConsumerCommand
,ConvertCommand
,CsvFilterCommand
,CsvNavigateCommand
,JsonFilterCommand
,JsonNavigateCommand
,LineEndingNormalizeCommand
,PmdXmlToCsvCommand
,PmdXmlToJsonCommand
,PmdXmlToMarkdownCommand
,SampleStreamCommand
,SendHttpCommand
,XmlFilterCommand
,XmlNavigateCommand
Abstract class for stream commands.
This class provides a template for executing commands on input streams and writing the results to output streams.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
execute
(InputStream inputStream, OutputStream outputStream) Executes the command on the provided input stream and writes the result to the output stream.protected abstract void
executeInternal
(InputStream inputStream, OutputStream outputStream) Abstract method to be implemented by subclasses for executing the command.protected String
コマンドの詳細情報を取得します。Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.streamconverter.command.IStreamCommand
execute
-
Constructor Details
-
AbstractStreamCommand
public AbstractStreamCommand()Default constructor.Initializes the command with default settings.
-
-
Method Details
-
execute
Executes the command on the provided input stream and writes the result to the output stream.This method automatically logs execution details including: - Command name and execution time - Input/output data sizes - Exception details if execution fails - Performance metrics
- Specified by:
execute
in 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.
-
executeInternal
protected abstract void executeInternal(InputStream inputStream, OutputStream outputStream) throws IOException Abstract method to be implemented by subclasses for executing the command.- 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.
-
getCommandDetails
コマンドの詳細情報を取得します。サブクラスでオーバーライドして、コマンド固有の設定や状態を返すことができます。 この情報はデバッグログに出力され、問題の診断に役立ちます。
- Returns:
- コマンドの詳細情報
-