Package org.apache.rat
Class Reporter
java.lang.Object
org.apache.rat.Reporter
Class that executes the report as defined in a
ReportConfiguration
and stores
the result for later handling.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute()
Executes the report and builds the output.Get the claim statistics from the run.static void
listLicenses
(ReportConfiguration configuration, LicenseSetFactory.LicenseFilter filter) Lists the licenses on the configured output stream.void
output()
Outputs the report using the stylesheet and output specified in the configuration.void
output
(org.apache.commons.io.function.IOSupplier<InputStream> stylesheet, org.apache.commons.io.function.IOSupplier<OutputStream> output) Outputs the report to the specified output using the stylesheet.void
writeSummary
(Appendable appendable) Writes a text summary of issues with the run.
-
Constructor Details
-
Reporter
Create the reporter.- Parameters:
configuration
- the configuration to use.
-
-
Method Details
-
execute
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 theoutput()
methods have already been called this method will return the previous results.- Returns:
- the claim statistics.
- Throws:
RatException
- on error.
-
getClaimsStatistic
Get the claim statistics from the run.- Returns:
- the claim statistics.
-
output
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 systemfilter
- the license filter that specifies which licenses to output.- Throws:
IOException
- if PrintWriter can not be retrieved from configuration.
-
writeSummary
Writes a text summary of issues with the run.- Parameters:
appendable
- the appendable to write to.- Throws:
IOException
- on error.
-