Class ReportGenerator

java.lang.Object
reports.ReportGenerator

public class ReportGenerator extends Object
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 Details

    • ReportGenerator

      private ReportGenerator()
      Private constructor to prevent instantiation of this utility class.
  • Method Details

    • generateProjectFrequencyReport

      public static org.json.JSONObject generateProjectFrequencyReport(List<Map<String,Object>> projects)
      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 write
      filePath - 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 CSV
      filePath - destination CSV file
      Throws:
      IOException - when file write fails