Class Reporter

java.lang.Object
org.apache.rat.Reporter

public class Reporter extends Object
Class that executes the report as defined in a ReportConfiguration and stores the result for later handling.
  • Constructor Details

    • Reporter

      public Reporter(ReportConfiguration configuration)
      Create the reporter.
      Parameters:
      configuration - the configuration to use.
  • Method Details

    • execute

      public ClaimStatistic execute() throws RatException
      Executes the report and builds the output. This method will build the internal XML document if it does not already exist. If this method or either of the output() methods have already been called this method will return the previous results.
      Returns:
      the claim statistics.
      Throws:
      RatException - on error.
    • getClaimsStatistic

      public ClaimStatistic getClaimsStatistic()
      Get the claim statistics from the run.
      Returns:
      the claim statistics.
    • output

      public void output() throws RatException
      Outputs the report using the stylesheet and output specified in the configuration.
      Throws:
      RatException - on error.
    • output

      public void output(org.apache.commons.io.function.IOSupplier<InputStream> stylesheet, org.apache.commons.io.function.IOSupplier<OutputStream> output) throws RatException
      Outputs the report to the specified output using the stylesheet. It is safe to call this method more than once in order to generate multiple reports from the same run.
      Parameters:
      stylesheet - the style sheet to use for XSLT formatting.
      output - the output stream to write to.
      Throws:
      RatException - on error.
    • listLicenses

      public static void listLicenses(ReportConfiguration configuration, LicenseSetFactory.LicenseFilter filter) throws IOException
      Lists the licenses on the configured output stream.
      Parameters:
      configuration - The configuration for the system
      filter - the license filter that specifies which licenses to output.
      Throws:
      IOException - if PrintWriter can not be retrieved from configuration.
    • writeSummary

      public void writeSummary(Appendable appendable) throws IOException
      Writes a text summary of issues with the run.
      Parameters:
      appendable - the appendable to write to.
      Throws:
      IOException - on error.