Package org.egothor.methodatlas.command
Class JsonCommand
java.lang.Object
org.egothor.methodatlas.command.JsonCommand
- All Implemented Interfaces:
Command
CLI command handler for the
-json output mode.
Scans one or more source roots, buffers all discovered test-method records, and serializes the result as a flat JSON array once the scan completes.
The JSON representation differs from CSV in the following ways:
tagsandai_tagsare JSON arrays, not semicolon-separated strings- Numeric fields are JSON numbers;
ai_security_relevantis a JSON boolean - Optional columns are omitted entirely when the corresponding flag is not enabled (rather than being left blank)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionJsonCommand(CliConfig cliConfig, org.egothor.methodatlas.api.TestDiscoveryConfig discoveryConfig, org.egothor.methodatlas.ai.AiSuggestionEngine aiEngine, org.egothor.methodatlas.emit.ClassificationOverride override, AiResultCache aiCache, PluginLoader pluginLoader, ScanOrchestrator scanOrchestrator) Creates a new JSON command. -
Method Summary
Modifier and TypeMethodDescriptionintexecute(PrintWriter out) Scans all roots and emits the buffered result as a JSON array.
-
Constructor Details
-
JsonCommand
public JsonCommand(CliConfig cliConfig, org.egothor.methodatlas.api.TestDiscoveryConfig discoveryConfig, org.egothor.methodatlas.ai.AiSuggestionEngine aiEngine, org.egothor.methodatlas.emit.ClassificationOverride override, AiResultCache aiCache, PluginLoader pluginLoader, ScanOrchestrator scanOrchestrator) Creates a new JSON command.- Parameters:
cliConfig- full parsed CLI configurationdiscoveryConfig- discovery configuration forwarded to providersaiEngine- AI engine providing suggestions;nullwhen AI is disabledoverride- human classification overridesaiCache- AI result cachepluginLoader- loader used to resolve and closeTestDiscoveryprovidersscanOrchestrator- scan-and-emit orchestrator used to process each root with the per-record sink
-
-
Method Details
-
execute
Scans all roots and emits the buffered result as a JSON array.- Specified by:
executein interfaceCommand- Parameters:
out- writer that receives the JSON output- Returns:
0if all files were processed successfully,1if any file produced a parse or processing error- Throws:
IOException- if traversing a file tree fails
-