public class Report
extends org.apache.tools.ant.Task
IHeaderMatcher(s) can be specified as nested elements as well.
The attribute format defines the output format and
can take the values
| Modifier and Type | Class and Description |
|---|---|
static class |
Report.AddLicenseHeaders
Type for the addLicenseHeaders attribute.
|
static class |
Report.Format
Type for the format attribute.
|
| Modifier and Type | Field and Description |
|---|---|
private boolean |
addDefaultLicenseMatchers
Whether to add the default list of license matchers.
|
private Report.AddLicenseHeaders |
addLicenseHeaders
Whether to add license headers.
|
private java.lang.String |
copyrightMessage
The copyright message.
|
private Report.Format |
format
Which format to use.
|
private java.util.ArrayList<IHeaderMatcher> |
licenseMatchers
The licenses we want to match on.
|
private java.util.ArrayList<ILicenseFamily> |
licenseNames |
private org.apache.tools.ant.types.resources.Union |
nestedResources
will hold any nested resource collection
|
private java.io.File |
reportFile
Where to send the report.
|
private org.apache.tools.ant.types.Resource |
stylesheet
Which stylesheet to use.
|
| Constructor and Description |
|---|
Report() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(IHeaderMatcher matcher) |
void |
add(ILicenseFamily license) |
void |
add(org.apache.tools.ant.types.ResourceCollection rc)
Adds resources that will be checked.
|
void |
addConfiguredStylesheet(org.apache.tools.ant.types.resources.Union u)
Which stylesheet to use (only meaningful with format='styled').
|
private void |
createReport(java.io.PrintWriter out)
Writes the report to the given stream.
|
void |
execute()
Generates the report.
|
private ILicenseFamily[] |
getApprovedLicenseNames() |
private java.util.List<IHeaderMatcher> |
getLicenseMatchers()
Flattens all nested matchers plus the default matchers (if
required) into a single array.
|
void |
setAddDefaultLicenseMatchers(boolean addDefaultLicenseMatchers) |
void |
setAddLicenseHeaders(Report.AddLicenseHeaders pAdd) |
void |
setCopyrightMessage(java.lang.String pMessage) |
void |
setFormat(Report.Format f)
Which format to use.
|
void |
setReportFile(java.io.File f)
Where to send the report to.
|
private void |
validate()
validates the task's configuration.
|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeprivate org.apache.tools.ant.types.resources.Union nestedResources
private java.util.ArrayList<IHeaderMatcher> licenseMatchers
private java.util.ArrayList<ILicenseFamily> licenseNames
private boolean addDefaultLicenseMatchers
private java.io.File reportFile
private Report.Format format
private org.apache.tools.ant.types.Resource stylesheet
private Report.AddLicenseHeaders addLicenseHeaders
private java.lang.String copyrightMessage
public void add(org.apache.tools.ant.types.ResourceCollection rc)
rc - resource to check.public void add(IHeaderMatcher matcher)
matcher - Adds a license matcher.public void add(ILicenseFamily license)
public void setAddDefaultLicenseMatchers(boolean addDefaultLicenseMatchers)
addDefaultLicenseMatchers - Whether to add the default list of license matchers.public void setReportFile(java.io.File f)
f - report output file.public void setFormat(Report.Format f)
f - format.public void setAddLicenseHeaders(Report.AddLicenseHeaders pAdd)
pAdd - Whether to add license headers.public void setCopyrightMessage(java.lang.String pMessage)
pMessage - copyright message to set.public void addConfiguredStylesheet(org.apache.tools.ant.types.resources.Union u)
u - stylesheet.public void execute()
execute in class org.apache.tools.ant.Taskprivate void validate()
private void createReport(java.io.PrintWriter out)
throws java.io.IOException,
javax.xml.transform.TransformerException,
java.lang.InterruptedException,
RatException
out - stream to write report to.java.io.IOException - in case of I/O errors.java.lang.InterruptedException - in case of threading errors.javax.xml.transform.TransformerException - in case of XML errors.RatException - in case of general errors.private java.util.List<IHeaderMatcher> getLicenseMatchers()
private ILicenseFamily[] getApprovedLicenseNames()