Package org.apache.rat.anttasks
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
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.use <editCopyright> amd <editOverwrite> instead.static classDeprecated.use listLicenses or listFamilies attributes.Nested classes/interfaces inherited from class org.apache.rat.anttasks.BaseAntTask
BaseAntTask.Cntr, BaseAntTask.Config, BaseAntTask.CounterMax, BaseAntTask.CounterMin, BaseAntTask.Exclude, BaseAntTask.Expr, BaseAntTask.Filename, BaseAntTask.Include, BaseAntTask.InputExclude, BaseAntTask.InputExcludeParsedScm, BaseAntTask.InputInclude, BaseAntTask.LicenseFamiliesApproved, BaseAntTask.LicenseFamiliesDenied, BaseAntTask.Licenses, BaseAntTask.LicensesApproved, BaseAntTask.LicensesDenied, BaseAntTask.Lst, BaseAntTask.Std, BaseAntTask.TxtValue -
Field Summary
Fields inherited from class org.apache.rat.anttasks.BaseAntTask
argsFields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapperFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(org.apache.tools.ant.types.ResourceCollection rc)Adds resources that will be checked.voidaddAddApprovedLicense(String familyCategory)Deprecated.use licensesFamiliesApproved child elementvoidDeprecated.Create a custom configuration file and use the config option.voidaddLicense(License license)Deprecated.Create a custom configuration file and use the config option.voidaddRemoveApprovedLicense(String familyCategory)Deprecated.use licensesFamiliesDenied child elementvoidaddRemoveApprovedLicense(String[] familyCategory)Deprecated.use licenseFamilyDenied elementvoidaddStylesheet(org.apache.tools.ant.types.Resource styleSheet)Deprecated.voidaddStyleSheet(org.apache.tools.ant.types.Resource styleSheet)Deprecated.voidexecute()Generates the report.static Log.LevelfromProjectLevel(int level)Converts to RAT log level from Ant Project log level.Creates the ReportConfiguration from the Ant options.Reads values for the Arg.voidvoidprotected voidRemoves the values for the arg.voidsetAddApprovedLicense(String familyCategory)Deprecated.use licensesApproved child element.voidsetAddDefaultDefinitions(File fileName)Deprecated.Use Config child elementvoidsetAddLicenseHeaders(Report.AddLicenseHeaders setting)Deprecated.use editLicense and editOverwrite attributesvoidsetCopyrightMessage(String copyrightMessage)Deprecated.use copyright attributevoidDeprecated.voidsetInputFileFilter(org.apache.commons.io.filefilter.IOFileFilter inputFileFilter)Deprecated.voidsetLicenses(File fileName)Deprecated.create a configuration file and use the <config> child element.voidsetRemoveApprovedLicense(String familyCategory)Deprecated.use licensesFamiliesDenied child elementvoidsetRemoveApprovedLicense(String[] familyCategory)Deprecated.use licenseFamiliesDenied elementvoidsetReportFile(File reportFile)Deprecated.use outputFile elementvoidsetStyleReport(boolean styleReport)Deprecated.useBaseAntTask.setOutputStyle(String)and pass "xml" or "plain-rat".voidsetUseDefaultLicenses(boolean useDefaultLicenses)Deprecated.use noDefaultLicenses attributeprotected ReportConfigurationvalidate(ReportConfiguration cfg)validates the task's configuration.Methods inherited from class org.apache.rat.anttasks.BaseAntTask
addArg, addArg, args, createConfig, createCounterMax, createCounterMin, createExclude, createInclude, createInputExclude, createInputExcludeParsedScm, createInputInclude, createLicenseFamiliesApproved, createLicenseFamiliesDenied, createLicenses, createLicensesApproved, createLicensesDenied, createName, getArg, removeArg, setAddLicense, setArg, setConfigurationNoDefaults, setCopyright, setDryRun, setEditCopyright, setEditLicense, setEditOverwrite, setExcludeFile, setForce, setHelpLicenses, setIncludesFile, setInputExcludeSize, setListFamilies, setListLicenses, setNoDefaultLicenses, setOut, setOutputArchive, setOutputFamilies, setOutputFile, setOutputLicenses, setOutputStandard, setOutputStyle, setScanHiddenDirectories, setStylesheet, setXml, unsupportedArgsMethods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
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.use outputFile elementSets the report file.- Parameters:
reportFile- the report file.
-
addLicense
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.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.Adds a style sheet to the system.- Parameters:
styleSheet- The style sheet to use for formatting.
-
addStyleSheet
Deprecated.Adds a given style sheet to the report.- Parameters:
styleSheet- style sheet to use in this report.
-
setStyleReport
Deprecated.useBaseAntTask.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.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.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.use noDefaultLicenses attributeSpecifies whether to add the default list of license matchers.- Parameters:
useDefaultLicenses- iftrueuse the default licenses.
-
setAddApprovedLicense
Deprecated.use licensesApproved child element.Adds a family category to the list of approved licenses.- Parameters:
familyCategory- the category to add.
-
addAddApprovedLicense
Deprecated.use licensesFamiliesApproved child elementAdds a family category to the list of approved licenses.- Parameters:
familyCategory- the category to add
-
setRemoveApprovedLicense
Deprecated.use licensesFamiliesDenied child elementRemoves a family category to the list of approved licenses.- Parameters:
familyCategory- the category to add.
-
addRemoveApprovedLicense
Deprecated.use licensesFamiliesDenied child elementRemoves a family category to the list of approved licenses.- Parameters:
familyCategory- the category to add.
-
setRemoveApprovedLicense
Deprecated.use licenseFamiliesDenied elementRemoves a family category to the list of approved licenses.- Parameters:
familyCategory- the category to remove
-
addRemoveApprovedLicense
Deprecated.use licenseFamilyDenied elementRemoves a family category to the list of approved licenses.- Parameters:
familyCategory- the category to remove.
-
setCopyrightMessage
Deprecated.use copyright attributeSets the copyright message- Parameters:
copyrightMessage- the copyright message
-
setAddLicenseHeaders
Deprecated.use editLicense and editOverwrite attributesDetermines if license headers should be added.- Parameters:
setting- the setting.
-
setAddDefaultDefinitions
Deprecated.Use Config child elementAdds definition information- Parameters:
fileName- the file to add
-
getValues
Reads values for the Arg.- Parameters:
arg- The Arg to get the values for.- Returns:
- The list of values or an empty list.
-
removeKey
Removes the values for the arg.- Parameters:
arg- the arg to remove the values for.
-
getConfiguration
Creates the ReportConfiguration from the Ant options.- Returns:
- the ReportConfiguration.
-
execute
public void execute()Generates the report.- Overrides:
executein classorg.apache.tools.ant.Task
-
validate
validates the task's configuration. -
log
- Overrides:
login classorg.apache.tools.ant.Task
-
log
- Overrides:
login classorg.apache.tools.ant.Task
-
fromProjectLevel
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.
-