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
-
Field Summary
Fields inherited from class com.streamconverter.command.AbstractStreamCommand
log -
Method Summary
Modifier and TypeMethodDescriptionstatic XmlFilterCommandFactory method for XML filtering with typed path selector.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
-
Method Details
-
create
Factory method for XML filtering with typed path selector.- Parameters:
xpath- the typed path to extract elements- Returns:
- an XmlFilterCommand instance
- Throws:
IllegalArgumentException- if xpath is null
-
execute
Description copied from class:AbstractStreamCommandExecutes the command on the provided input stream and writes the result to the output stream.- Specified by:
executein interfaceIStreamCommand- Specified by:
executein 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.
-