Class Report

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.rat.anttasks.BaseAntTask
org.apache.rat.anttasks.Report
All Implemented Interfaces:
Cloneable

public class Report extends BaseAntTask
A basic Ant task that generates a report on all files specified by the nested resource collection(s).

IHeaderMatcher(s) can be specified as nested elements as well.

The attribute format defines the output format and can take the values

  • xml - RAT's native XML output.
  • styled - transforms the XML output using the given stylesheet. The stylesheet attribute must be set as well if this attribute is used.
  • plain - plain text using RAT's built-in stylesheet. This is the default.
  • Constructor Details

    • Report

      public Report()
      Constructor.
  • Method Details

    • add

      public void add(org.apache.tools.ant.types.ResourceCollection rc)
      Adds resources that will be checked.
      Parameters:
      rc - resource to check.
    • setInputFileFilter

      @Deprecated public void setInputFileFilter(org.apache.commons.io.filefilter.IOFileFilter inputFileFilter)
      Deprecated.
      Adds an input file filter.
      Parameters:
      inputFileFilter - The input file filter to add.
    • setReportFile

      @Deprecated public void setReportFile(File reportFile)
      Deprecated.
      use outputFile element
      Sets the report file.
      Parameters:
      reportFile - the report file.
    • addLicense

      @Deprecated public void addLicense(License license)
      Deprecated.
      Create a custom configuration file and use the config option.
      Adds an inline License definition to the system.
      Parameters:
      license - the license to add.
    • addFamily

      @Deprecated public void addFamily(Family family)
      Deprecated.
      Create a custom configuration file and use the config option.
      Add an inline license family definition to the system.
      Parameters:
      family - the license family to add.
    • addStylesheet

      @Deprecated public void addStylesheet(org.apache.tools.ant.types.Resource styleSheet)
      Adds a style sheet to the system.
      Parameters:
      styleSheet - The style sheet to use for formatting.
    • addStyleSheet

      @Deprecated public void addStyleSheet(org.apache.tools.ant.types.Resource styleSheet)
      Adds a given style sheet to the report.
      Parameters:
      styleSheet - style sheet to use in this report.
    • setStyleReport

      @Deprecated public void setStyleReport(boolean styleReport)
      Deprecated.
      use BaseAntTask.setOutputStyle(String) and pass "xml" or "plain-rat".
      Styles the report or deliver xml document.
      Parameters:
      styleReport - true to use the plain-rat style
    • setFormat

      @Deprecated public void setFormat(String style)
      Determines if the output should be styled.
      Parameters:
      style - the name of the style sheet ot use, or "styled" for plain-rat style
    • setLicenses

      @Deprecated public void setLicenses(File fileName)
      Deprecated.
      create a configuration file and use the <config> child element.
      Adds as a file containing the definitions of licenses to the system.
      Parameters:
      fileName - the file to add.
    • setUseDefaultLicenses

      @Deprecated public void setUseDefaultLicenses(boolean useDefaultLicenses)
      Deprecated.
      use noDefaultLicenses attribute
      Specifies whether to add the default list of license matchers.
      Parameters:
      useDefaultLicenses - if true use the default licenses.
    • setAddApprovedLicense

      @Deprecated public void setAddApprovedLicense(String familyCategory)
      Deprecated.
      use licensesApproved child element.
      Adds a family category to the list of approved licenses.
      Parameters:
      familyCategory - the category to add.
    • addAddApprovedLicense

      @Deprecated public void addAddApprovedLicense(String familyCategory)
      Deprecated.
      use licensesFamiliesApproved child element
      Adds a family category to the list of approved licenses.
      Parameters:
      familyCategory - the category to add
    • setRemoveApprovedLicense

      @Deprecated public void setRemoveApprovedLicense(String familyCategory)
      Deprecated.
      use licensesFamiliesDenied child element
      Removes a family category to the list of approved licenses.
      Parameters:
      familyCategory - the category to add.
    • addRemoveApprovedLicense

      @Deprecated public void addRemoveApprovedLicense(String familyCategory)
      Deprecated.
      use licensesFamiliesDenied child element
      Removes a family category to the list of approved licenses.
      Parameters:
      familyCategory - the category to add.
    • setRemoveApprovedLicense

      @Deprecated public void setRemoveApprovedLicense(String[] familyCategory)
      Deprecated.
      use licenseFamiliesDenied element
      Removes a family category to the list of approved licenses.
      Parameters:
      familyCategory - the category to remove
    • addRemoveApprovedLicense

      @Deprecated public void addRemoveApprovedLicense(String[] familyCategory)
      Deprecated.
      use licenseFamilyDenied element
      Removes a family category to the list of approved licenses.
      Parameters:
      familyCategory - the category to remove.
    • setCopyrightMessage

      @Deprecated public void setCopyrightMessage(String copyrightMessage)
      Deprecated.
      use copyright attribute
      Sets the copyright message
      Parameters:
      copyrightMessage - the copyright message
    • setAddLicenseHeaders

      @Deprecated public void setAddLicenseHeaders(Report.AddLicenseHeaders setting)
      Deprecated.
      use editLicense and editOverwrite attributes
      Determines if license headers should be added.
      Parameters:
      setting - the setting.
    • setAddDefaultDefinitions

      @Deprecated public void setAddDefaultDefinitions(File fileName)
      Deprecated.
      Use Config child element
      Adds definition information
      Parameters:
      fileName - the file to add
    • getValues

      protected List<String> getValues(Arg arg)
      Reads values for the Arg.
      Parameters:
      arg - The Arg to get the values for.
      Returns:
      The list of values or an empty list.
    • removeKey

      protected void removeKey(Arg arg)
      Removes the values for the arg.
      Parameters:
      arg - the arg to remove the values for.
    • getConfiguration

      public ReportConfiguration getConfiguration()
      Creates the ReportConfiguration from the ant options.
      Returns:
      the ReportConfiguration.
    • execute

      public void execute()
      Generates the report.
      Overrides:
      execute in class org.apache.tools.ant.Task
    • validate

      protected ReportConfiguration validate(ReportConfiguration cfg)
      validates the task's configuration.
    • log

      public void log(String msg, int msgLevel)
      Overrides:
      log in class org.apache.tools.ant.Task
    • log

      public void log(String msg, Throwable t, int msgLevel)
      Overrides:
      log in class org.apache.tools.ant.Task
    • fromProjectLevel

      public static Log.Level fromProjectLevel(int level)
      Converts to RAT log level from Ant Project log level.
      Parameters:
      level - the Ant Project log level to convert.
      Returns:
      the equivalent RAT log level.