Package org.ossreviewtoolkit.evaluator
Class PackageRule.LicenseRule
-
- All Implemented Interfaces:
public final class PackageRule.LicenseRule extends Rule
-
-
Field Summary
Fields Modifier and Type Field Description private final SpdxSingleLicenseExpressionlicenseprivate final Stringdescriptionprivate final ResolvedLicenseresolvedLicenseprivate final LicenseSourcelicenseSourceprivate final List<RuleMatcher>matchersprivate final List<RuleViolation>violationsprivate final RuleSetruleSetprivate final Stringname
-
Constructor Summary
Constructors Constructor Description PackageRule.LicenseRule(String name, ResolvedLicense resolvedLicense, LicenseSource licenseSource)
-
Method Summary
Modifier and Type Method Description final SpdxSingleLicenseExpressiongetLicense()A shortcut for the license in resolvedLicense. StringgetDescription()Return a human-readable description of this rule. final ResolvedLicensegetResolvedLicense()The ResolvedLicense. final LicenseSourcegetLicenseSource()The source of the license. final CuratedPackagepkg()A helper function to access PackageRule.pkg in extension functions for LicenseRule, required because the properties of the outer class PackageRule cannot be accessed from an extension function. StringissueSource()Return a string to be used as Issue. final RuleMatcherisExcluded()A RuleMatcher that checks if a detected license is excluded. final RuleMatcherisSpdxLicense()A RuleMatcher that checks if the license is a valid SPDX license. final Unitissue(Severity severity, String message, String howToFix)final Unithint(String message, String howToFix)Add a hint to the list of violations. final Unitwarning(String message, String howToFix)Add a warning to the list of violations. final Uniterror(String message, String howToFix)Add an error to the list of violations. -
Methods inherited from class org.ossreviewtoolkit.evaluator.Rule
error, evaluate, getMatchers, getName, getRuleSet, getViolations, hasLabel, hint, issue, require, runInternal, warning -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
PackageRule.LicenseRule
PackageRule.LicenseRule(String name, ResolvedLicense resolvedLicense, LicenseSource licenseSource)
-
-
Method Detail
-
getLicense
final SpdxSingleLicenseExpression getLicense()
A shortcut for the license in resolvedLicense.
-
getDescription
String getDescription()
Return a human-readable description of this rule.
-
getResolvedLicense
final ResolvedLicense getResolvedLicense()
The ResolvedLicense.
-
getLicenseSource
final LicenseSource getLicenseSource()
The source of the license.
-
pkg
final CuratedPackage pkg()
A helper function to access PackageRule.pkg in extension functions for LicenseRule, required because the properties of the outer class PackageRule cannot be accessed from an extension function.
-
issueSource
String issueSource()
-
isExcluded
final RuleMatcher isExcluded()
A RuleMatcher that checks if a detected license is excluded.
-
isSpdxLicense
final RuleMatcher isSpdxLicense()
A RuleMatcher that checks if the license is a valid SPDX license.
-
warning
final Unit warning(String message, String howToFix)
Add a warning to the list of violations.
-
-
-
-