Class XmlFilterCommand
java.lang.Object
com.streamconverter.command.AbstractStreamCommand
com.streamconverter.command.impl.xml.XmlFilterCommand
- All Implemented Interfaces:
IStreamCommand
XML Filter Command Class
This class implements pure data extraction from XML using TreePath expressions. Unlike XmlNavigateCommand which applies transformations, XmlFilterCommand only extracts/filters elements based on specified paths without any modifications.
Features: - Extract specific elements using TreePath expressions - Preserve exact XML structure of extracted elements - Memory-efficient streaming processing - Support for complex path expressions including nested elements and attributes
-
Constructor Summary
ConstructorsConstructorDescriptionXmlFilterCommand
(IPath<List<String>> xpath) Constructor for XML filtering with typed TreePath selector. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
executeInternal
(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
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
-
XmlFilterCommand
Constructor for XML filtering with typed TreePath selector.- Parameters:
xpath
- the typed TreePath to extract elements- Throws:
IllegalArgumentException
- if xpath is null
-
-
Method Details
-
getCommandDetails
Description copied from class:AbstractStreamCommand
コマンドの詳細情報を取得します。サブクラスでオーバーライドして、コマンド固有の設定や状態を返すことができます。 この情報はデバッグログに出力され、問題の診断に役立ちます。
- Overrides:
getCommandDetails
in classAbstractStreamCommand
- Returns:
- コマンドの詳細情報
-
executeInternal
protected void executeInternal(InputStream inputStream, OutputStream outputStream) throws IOException Description copied from class:AbstractStreamCommand
Abstract method to be implemented by subclasses for executing the command.- Specified by:
executeInternal
in 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.
-