Class JsonFilterCommand
java.lang.Object
com.streamconverter.command.AbstractStreamCommand
com.streamconverter.command.impl.json.JsonFilterCommand
- All Implemented Interfaces:
IStreamCommand
JSON Filter Command Class
This class implements pure data extraction from JSON using TreePath expressions. Unlike JsonNavigateCommand which applies transformations, JsonFilterCommand only extracts/filters data based on specified paths without any modifications.
Features: - Extract specific elements using TreePath expressions - Preserve exact data types and structure of extracted elements - Memory-efficient processing for large JSON files - Support for simple path expressions
-
Field Summary
Fields inherited from class com.streamconverter.command.AbstractStreamCommand
log -
Constructor Summary
ConstructorsConstructorDescriptionJsonFilterCommand(IPath<List<String>> jsonPath) Constructor for JSON filtering with typed TreePath selector. -
Method Summary
Modifier and TypeMethodDescriptionprotected 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
-
JsonFilterCommand
Constructor for JSON filtering with typed TreePath selector.- Parameters:
jsonPath- the typed TreePath to extract data- Throws:
IllegalArgumentException- if jsonPath is null
-
-
Method Details
-
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.
-