public class ReportConfiguration extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ReportConfiguration.NoCloseOutputStream
A wrapper around an output stream that does not close the output stream.
|
static class |
ReportConfiguration.Processing
The styles of processing for various categories of documents.
|
Constructor and Description |
---|
ReportConfiguration(Log log)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addApprovedLicenseCategories(Collection<String> approvedLicenseCategories)
Adds a collection of license family categories to the set of approved license
names.
|
void |
addApprovedLicenseCategory(ILicenseFamily approvedILicenseFamily)
Adds an ILicenseFamily to the list of approved licenses.
|
void |
addApprovedLicenseCategory(String familyCategory)
Adds a license family category (id) to the list of approved licenses
|
void |
addDirectoryToIgnore(org.apache.commons.io.filefilter.IOFileFilter directoryToIgnore)
Adds a directory filter to the directories to ignore.
|
void |
addFamilies(Collection<ILicenseFamily> families)
Adds multiple families to the list of license families.
|
void |
addFamily(ILicenseFamily.Builder builder)
Adds a license family to the list of families.
|
void |
addFamily(ILicenseFamily family)
Adds a license family to the list of families.
|
ILicense |
addLicense(ILicense.Builder builder)
Adds a license to the list of licenses.
|
void |
addLicense(ILicense license)
Adds a license to the list of licenses.
|
void |
addLicenses(Collection<ILicense> licenses)
Adds multiple licenses to the list of licenses.
|
void |
addLicensesIfNotPresent(Collection<ILicense> licenses)
Adds multiple licenses to the list of licenses.
|
void |
familyDuplicateOption(ReportingSet.Options state)
Sets the reporting option for duplicate license families.
|
SortedSet<String> |
getApprovedLicenseCategories()
Gets the SortedSet of approved license categories.
|
ReportConfiguration.Processing |
getArchiveProcessing()
Retrieves the archive processing type.
|
String |
getCopyrightMessage()
Returns the optional license copyright being added if RAT is adding headers.
|
org.apache.commons.io.filefilter.IOFileFilter |
getDirectoriesToIgnore()
Gets the directories filter.
|
org.apache.commons.io.filefilter.IOFileFilter |
getFilesToIgnore()
Gets the file name filter for files to ignore.
|
SortedSet<ILicenseFamily> |
getLicenseFamilies(LicenseSetFactory.LicenseFilter filter)
Gets a sorted set of ILicenseFamily objects based on
filter . if
filter is set:
all - All licenses families will be returned. |
SortedSet<ILicense> |
getLicenses(LicenseSetFactory.LicenseFilter filter)
Gets a set Licenses of depending on the
filter if filter is set:
all - All licenses will be returned. |
Log |
getLog()
Retrieves the Log that was provided in the constructor.
|
org.apache.commons.io.function.IOSupplier<OutputStream> |
getOutput()
Returns the output stream supplier.
|
IReportable |
getReportable()
Gets the reportable object.
|
ReportConfiguration.Processing |
getStandardProcessing()
Retrieves the archive processing type.
|
org.apache.commons.io.function.IOSupplier<InputStream> |
getStyleSheet()
Gets the IOSupplier with the style sheet.
|
org.apache.commons.io.function.IOSupplier<PrintWriter> |
getWriter()
Gets a PrintWriter that wraps the output stream.
|
boolean |
isAddingLicenses() |
boolean |
isAddingLicensesForced()
This value is ignored if RAT is not adding licenses.
|
boolean |
isDryRun()
Returns the state of the dry run flag.
|
boolean |
isStyleReport()
Returns
true if the XML report should be styled. |
void |
licenseDuplicateOption(ReportingSet.Options state)
Sets the reporting option for duplicate licenses.
|
LicenseSetFactory.LicenseFilter |
listFamilies() |
void |
listFamilies(LicenseSetFactory.LicenseFilter filter)
Set the level of license families that should be output in the XML document.
|
LicenseSetFactory.LicenseFilter |
listLicenses()
Gets the selected license filter.
|
void |
listLicenses(LicenseSetFactory.LicenseFilter filter)
Set the level of licenses that should be output in the XML document.
|
void |
logFamilyCollisions(Log.Level level)
Set the log level for reporting collisions in the set of license families.
|
void |
logLicenseCollisions(Log.Level level)
Sets the log level for reporting license collisions.
|
void |
removeApprovedLicenseCategories(Collection<String> familyCategory)
Removes a license family category from the list of approved licenses.
|
void |
removeApprovedLicenseCategory(String familyCategory)
Adds a license family category to the list of approved licenses.
|
void |
setAddLicenseHeaders(AddLicenseHeaders addLicenseHeaders)
Sets whether RAT should enable, disable, or force the adding of license
headers.
|
void |
setArchiveProcessing(ReportConfiguration.Processing archiveProcessing)
Sets the archive processing type.
|
void |
setCopyrightMessage(String copyrightMessage)
Sets the optional copyright message used if RAT is adding license headers.
|
void |
setDirectoriesToIgnore(org.apache.commons.io.filefilter.IOFileFilter directoriesToIgnore)
Sets the directories to ignore.
|
void |
setDryRun(boolean state)
Sets the dry run flag.
|
void |
setFilesToIgnore(org.apache.commons.io.filefilter.IOFileFilter filesToIgnore)
Sets the files name filter for files to ignore.
|
void |
setFrom(Defaults defaults)
Adds the licenses and approved licenses from the defaults object to the
configuration.
|
void |
setOut(File file)
Sets the OutputStream supplier to use the specified file.
|
void |
setOut(org.apache.commons.io.function.IOSupplier<OutputStream> out)
Sets the supplier for the output stream.
|
void |
setReportable(IReportable reportable)
Sets the reportable object.
|
void |
setStandardProcessing(ReportConfiguration.Processing standardProcessing)
Sets the archive processing type.
|
void |
setStyleReport(boolean styleReport)
Specifies that the XML report should or should not be styled.
|
void |
setStyleSheet(File styleSheet)
Sets the style sheet.
|
void |
setStyleSheet(org.apache.commons.io.function.IOSupplier<InputStream> styleSheet)
Sets the style sheet for custom processing.
|
void |
setStyleSheet(URI styleSheet)
Sets the style sheet for custom processing.
|
void |
setStyleSheet(URL styleSheet)
Sets the style sheet for custom processing.
|
void |
validate(Consumer<String> logger)
Validates that the configuration is valid.
|
public ReportConfiguration(Log log)
log
- The Log implementation that messages will be written to.public ReportConfiguration.Processing getArchiveProcessing()
public void setArchiveProcessing(ReportConfiguration.Processing archiveProcessing)
archiveProcessing
- the type of processing archives should have.public ReportConfiguration.Processing getStandardProcessing()
public void setStandardProcessing(ReportConfiguration.Processing standardProcessing)
standardProcessing
- the type of processing archives should have.public Log getLog()
public void logFamilyCollisions(Log.Level level)
NOTE: should be set before licenses or license families are added.
level
- The log level to use.public void familyDuplicateOption(ReportingSet.Options state)
state
- The ReportingSet.Option to use for reporting.public void logLicenseCollisions(Log.Level level)
level
- The log level.public void licenseDuplicateOption(ReportingSet.Options state)
state
- the ReportingSt.Option to use for reporting.public void listFamilies(LicenseSetFactory.LicenseFilter filter)
filter
- the license families to list.public LicenseSetFactory.LicenseFilter listFamilies()
public void listLicenses(LicenseSetFactory.LicenseFilter filter)
filter
- the licenses to list.public LicenseSetFactory.LicenseFilter listLicenses()
public void setDryRun(boolean state)
state
- the state for the dry run flag.public boolean isDryRun()
public org.apache.commons.io.filefilter.IOFileFilter getFilesToIgnore()
public void setFilesToIgnore(org.apache.commons.io.filefilter.IOFileFilter filesToIgnore)
null
uses the Default.FILES_TO_IGNORE value.filesToIgnore
- the filename filter to filter the input files.Defaults.FILES_TO_IGNORE
public org.apache.commons.io.filefilter.IOFileFilter getDirectoriesToIgnore()
public void setDirectoriesToIgnore(org.apache.commons.io.filefilter.IOFileFilter directoriesToIgnore)
directoriesToIgnore
is null removes all directories to ignore.
If not set Defaults.DIRECTORIES_TO_IGNORE
is used.directoriesToIgnore
- the filter that defines the directories to ignore.Defaults.DIRECTORIES_TO_IGNORE
public void addDirectoryToIgnore(org.apache.commons.io.filefilter.IOFileFilter directoryToIgnore)
directoryToIgnore
- the directory filter to add.public IReportable getReportable()
public void setReportable(IReportable reportable)
reportable
- the thing being reported on.public org.apache.commons.io.function.IOSupplier<InputStream> getStyleSheet()
public void setStyleSheet(org.apache.commons.io.function.IOSupplier<InputStream> styleSheet)
styleSheet
- the XSLT style sheet to style the report with.public void setFrom(Defaults defaults)
defaults
- The defaults to set.public void setStyleSheet(File styleSheet)
styleSheet
- the XSLT style sheet file to style the report with.public void setStyleSheet(URI styleSheet)
styleSheet
- the URI of the XSLT style sheet to style the report with.public void setStyleSheet(URL styleSheet)
styleSheet
- the URL of the XSLT style sheet to style the report with.public boolean isStyleReport()
true
if the XML report should be styled.true
if the XML report should be styled.public void setStyleReport(boolean styleReport)
styleReport
- specifies whether the XML report should be styled.public void setOut(org.apache.commons.io.function.IOSupplier<OutputStream> out)
OutputStream
should not be
closed consider wrapping it in a NoCloseOutputStream
out
- The OutputStream supplier that provides the output stream to write
the report to. A null value will use System.out.ReportConfiguration.NoCloseOutputStream
public void setOut(File file)
file
- The file to create the supplier with.setOut(IOSupplier)
public org.apache.commons.io.function.IOSupplier<OutputStream> getOutput()
public org.apache.commons.io.function.IOSupplier<PrintWriter> getWriter()
getOutput()
public void addLicense(ILicense license)
license
- The license to add to the list of licenses.public ILicense addLicense(ILicense.Builder builder)
builder
- The license builder to build and add to the list of licenses.public void addLicenses(Collection<ILicense> licenses)
licenses
- The licenses to add.public void addLicensesIfNotPresent(Collection<ILicense> licenses)
licenses
- The licenses to add.public void addFamily(ILicenseFamily family)
family
- The license family to add to the list of license families.public void addFamily(ILicenseFamily.Builder builder)
builder
- The licenseFamily.Builder to build and add to the list of
licenses.public void addFamilies(Collection<ILicenseFamily> families)
families
- The license families to add.public void addApprovedLicenseCategory(ILicenseFamily approvedILicenseFamily)
approvedILicenseFamily
- the LicenseFamily to add.public void addApprovedLicenseCategory(String familyCategory)
familyCategory
- the category to add.public void addApprovedLicenseCategories(Collection<String> approvedLicenseCategories)
approvedLicenseCategories
- set of approved license categories.public void removeApprovedLicenseCategory(String familyCategory)
familyCategory
- the category to add.public void removeApprovedLicenseCategories(Collection<String> familyCategory)
familyCategory
- the family category to remove.public SortedSet<String> getApprovedLicenseCategories()
public String getCopyrightMessage()
isAddingLicenses()
public void setCopyrightMessage(String copyrightMessage)
copyrightMessage
- message to set.isAddingLicenses()
public boolean isAddingLicensesForced()
true
if RAT is forcing the adding license headers.isAddingLicenses()
public boolean isAddingLicenses()
isAddingLicensesForced()
,
getCopyrightMessage()
public void setAddLicenseHeaders(AddLicenseHeaders addLicenseHeaders)
addLicenseHeaders
- enables/disables or forces adding of licenses
headers.isAddingLicenses()
,
setCopyrightMessage(String)
public SortedSet<ILicense> getLicenses(LicenseSetFactory.LicenseFilter filter)
filter
if filter is set:
all
- All licenses will be returned.approved
- Only approved licenses will be returnednone
- No licenses will be returnedfilter
- The license filter.public SortedSet<ILicenseFamily> getLicenseFamilies(LicenseSetFactory.LicenseFilter filter)
filter
. if
filter is set:
all
- All licenses families will be returned.approved
- Only approved license families will be returnednone
- No license families will be returnedfilter
- The license filter.Copyright © 2006–2024 Apache Software Foundation. All rights reserved.