Package com.streamconverter.sloc.command
Class ModuleXmlConcatCommand
java.lang.Object
com.streamconverter.command.AbstractStreamCommand
com.streamconverter.sloc.command.ModuleXmlConcatCommand
- All Implemented Interfaces:
IStreamCommand
モジュール名リストを読み込み、各モジュールの JaCoCo XML ファイルを連結して出力するコマンド。
入力: モジュール名を1行ずつ列挙したテキスト(プロジェクトルートからの相対パス解決に使用)
streamconverter-core streamconverter-db ...
出力: 各モジュールの <report> 要素を連結したストリーム。XML宣言・DOCTYPE宣言は全モジュールで除去し、 先頭に <?xml
version="1.0" encoding="UTF-8"?> を1つだけ付与する。結果は複数のルート要素を持つ Well-formed ではない XML となるが、JacocoXmlToModuleSlocCommand が <jacoco-reports> ラッパーで包んでパースするため実用上は問題ない。
YAGNI: 厳密な Well-formed XML が必要になった場合は、ラッパー要素で包む対応が容易にできる。
-
Field Summary
Fields inherited from class com.streamconverter.command.AbstractStreamCommand
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(InputStream input, OutputStream output) 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
-
Constructor Details
-
ModuleXmlConcatCommand
- Parameters:
projectRoot- JaCoCo XML を探すプロジェクトルートディレクトリ
-
-
Method Details
-
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:
input- The input stream to read data from.output- The output stream to write data to.- Throws:
IOException- If an I/O error occurs during the execution of the command.
-