Class ReportGenerator
java.lang.Object
reports.ReportGenerator
Simple reporting utilities which produce JSON or CSV summaries from the
in-memory project representations. These methods are stateless and useful
for generating artifacts that can be embedded in the project's site.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePrivate constructor to prevent instantiation of this utility class. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidexportReportToCsv(org.json.JSONObject report, String filePath) Export a JSON report to a simple CSV text representation.static voidexportReportToJson(org.json.JSONObject report, String filePath) Persist a JSON report to disk as pretty-printed JSON.static org.json.JSONObjectgenerateProjectFrequencyReport(List<Map<String, Object>> projects) Create a frequency report indicating the most- and least-printed project names from a list of project maps.
-
Constructor Details
-
ReportGenerator
private ReportGenerator()Private constructor to prevent instantiation of this utility class.
-
-
Method Details
-
generateProjectFrequencyReport
Create a frequency report indicating the most- and least-printed project names from a list of project maps.- Parameters:
projects- list of project maps (each expected to have a `name` key)- Returns:
- JSONObject containing `most_printed` and `least_printed` entries
-
exportReportToJson
public static void exportReportToJson(org.json.JSONObject report, String filePath) throws IOException Persist a JSON report to disk as pretty-printed JSON.- Parameters:
report- JSON object to writefilePath- destination file path- Throws:
IOException- when file write fails
-
exportReportToCsv
public static void exportReportToCsv(org.json.JSONObject report, String filePath) throws IOException Export a JSON report to a simple CSV text representation. Each top-level key/value pair becomes a CSV row in the form `key,value`.- Parameters:
report- JSON object to convert to CSVfilePath- destination CSV file- Throws:
IOException- when file write fails
-