Class CsvNavigateCommand
java.lang.Object
com.streamconverter.command.AbstractStreamCommand
com.streamconverter.command.impl.csv.CsvNavigateCommand
- All Implemented Interfaces:
IStreamCommand
CSV Navigate Command Class
This class implements command for targeted CSV transformation using column selectors. It identifies specific columns using column names or indices and applies IRule transformations to those columns while preserving the overall CSV structure.
-
Field Summary
Fields inherited from class com.streamconverter.command.AbstractStreamCommand
log -
Constructor Summary
ConstructorsConstructorDescriptionCsvNavigateCommand(CSVPath columnSelector, IRule rule) Constructor for CSV navigation with typed column selector and transformation rule.CsvNavigateCommand(TreePath treePath, IRule rule) Constructor for CSV navigation with TreePath (for compatibility).CsvNavigateCommand(String columnSelector, IRule rule) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic CsvNavigateCommandFactory method for creating a CSV navigation command with typed column selector and rule.static CsvNavigateCommandDeprecated.Usecreate(CSVPath, IRule)insteadprotected voidexecuteInternal(InputStream inputStream, OutputStream outputStream) Abstract method to be implemented by subclasses for executing the command.protected Stringコマンドの詳細情報を取得します。Methods inherited from class com.streamconverter.command.AbstractStreamCommand
execute, execute
-
Constructor Details
-
CsvNavigateCommand
Deprecated.UseCsvNavigateCommand(CSVPath, IRule)insteadConstructor for CSV navigation with column selector and transformation rule.- Parameters:
columnSelector- the column name or index to select (e.g., "name", "2")rule- the transformation rule to apply to selected column- Throws:
IllegalArgumentException- if columnSelector or rule is null
-
CsvNavigateCommand
Constructor for CSV navigation with typed column selector and transformation rule.- Parameters:
columnSelector- the typed CSVPath to select columnrule- the transformation rule to apply to selected column- Throws:
IllegalArgumentException- if columnSelector or rule is null
-
CsvNavigateCommand
Constructor for CSV navigation with TreePath (for compatibility).- Parameters:
treePath- the TreePath representing column selectorrule- the transformation rule to apply to selected column- Throws:
IllegalArgumentException- if treePath or rule is null
-
-
Method Details
-
create
Deprecated.Usecreate(CSVPath, IRule)insteadFactory method for creating a CSV navigation command with explicit rule specification. This method makes the intention explicit: extract data from the specified column and apply the given transformation rule.- Parameters:
columnSelector- the column name or index to select (e.g., "name", "2")rule- the transformation rule to apply to selected column data- Returns:
- a CsvNavigateCommand that extracts the specified column with the given rule
- Throws:
IllegalArgumentException- if rule is null
-
create
Factory method for creating a CSV navigation command with typed column selector and rule.- Parameters:
columnSelector- the typed CSVPath to select columnrule- the transformation rule to apply to selected column data- Returns:
- a CsvNavigateCommand that extracts the specified column with the given rule
- Throws:
IllegalArgumentException- if rule is null
-
getCommandDetails
Description copied from class:AbstractStreamCommandコマンドの詳細情報を取得します。サブクラスでオーバーライドして、コマンド固有の設定や状態を返すことができます。 この情報はデバッグログに出力され、問題の診断に役立ちます。
- Overrides:
getCommandDetailsin classAbstractStreamCommand- Returns:
- コマンドの詳細情報
-
executeInternal
protected void executeInternal(InputStream inputStream, OutputStream outputStream) throws IOException Description copied from class:AbstractStreamCommandAbstract method to be implemented by subclasses for executing the command.- Specified by:
executeInternalin classAbstractStreamCommand- 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.
-
CsvNavigateCommand(CSVPath, IRule)instead