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)
      Sets the report file.
      Parameters:
      reportFile - the report file.
    • addLicense

      public void addLicense(License license)
      Adds an inline License definition to the system.
      Parameters:
      license - the license to add.
    • addFamily

      public void addFamily(Family family)
      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 -
    • 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.setXml(boolean). Note reversal of boolean value
      Sets a stylesheet for the report.
      Parameters:
      styleReport -
    • setFormat

      @Deprecated public void setFormat(String style)
      Determines if the output should be styled.
      Parameters:
      style -
    • setLicenses

      public void setLicenses(File fileName)
      Deprecated.
      use licenses 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 addApprovedLicense child element.
      Adds a family category to the list of approved licenses.
      Parameters:
      familyCategory - the category to add.
    • addAddApprovedLicense

      public void addAddApprovedLicense(String familyCategory)
      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 removeApprovedLicense child element
      Removes a family category to the list of approved licenses.
      Parameters:
      familyCategory - the category to add.
    • addRemoveApprovedLicense

      public void addRemoveApprovedLicense(String familyCategory)
      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 removeApprovedLicense element
      Removes a family category to the list of approved licenses.
      Parameters:
      familyCategory - the category to add.
    • addRemoveApprovedLicense

      public void addRemoveApprovedLicense(String[] familyCategory)
      Removes a family category to the list of approved licenses.
      Parameters:
      familyCategory - the category to add.
    • 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 addLicense and force attributes
      Determines if license headers should be added.
      Parameters:
      setting - the setting.
    • setAddDefaultDefinitions

      @Deprecated public void setAddDefaultDefinitions(File fileName)
      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.