Class DependencyRule
-
- All Implemented Interfaces:
public final class DependencyRule extends PackageRule
A Rule to check a single dependency.
-
-
Field Summary
Fields Modifier and Type Field Description private final Stringdescriptionprivate final DependencyNodedependencyprivate final List<DependencyNode>ancestorsprivate final Integerlevelprivate final StringscopeNameprivate final Projectprojectprivate final PackageuncuratedPkgprivate final CuratedPackagepkgprivate final ResolvedLicenseInforesolvedLicenseInfoprivate final List<RuleMatcher>matchersprivate final List<RuleViolation>violationsprivate final RuleSetruleSetprivate final Stringname
-
Method Summary
Modifier and Type Method Description StringgetDescription()Return a human-readable description of this rule. final DependencyNodegetDependency()The dependency to check. final List<DependencyNode>getAncestors()The ancestors of the dependency in the dependency tree, sorted from farthest to closest: The first entry is the direct dependency of a project, the last entry (at index level - 1) is a direct parent of this dependency.final IntegergetLevel()The level of the dependency inside the dependency tree. final StringgetScopeName()The name of the scope that contains the dependency. final ProjectgetProject()The Project that contains the dependency. StringissueSource()Return a string to be used as Issue. final List<DependencyNode>directDependencies()Return the direct dependencies of the dependency. final RuleMatcherisAtTreeLevel(Integer level)A RuleMatcher that checks if the level of the dependency inside the dependency tree equals level, which starts with 0 for a direct dependency. final RuleMatcherisProjectFromOrg(String names)A RuleMatcher that checks if the identifier of the project belongs to one of the provided orgs. final RuleMatcherisStaticallyLinked()A RuleMatcher that checks if the dependency is statically linked. -
Methods inherited from class org.ossreviewtoolkit.evaluator.PackageRule
error, getPkg, getResolvedLicenseInfo, getUncuratedPkg, hasLicense, hasVulnerability, hasVulnerability, hint, isExcluded, isFromOrg, isMetadataOnly, isProject, isType, issue, licenseRule, runInternal, warning -
Methods inherited from class org.ossreviewtoolkit.evaluator.Rule
error, evaluate, getMatchers, getName, getRuleSet, getViolations, hasLabel, hint, issue, require, warning -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getDescription
String getDescription()
Return a human-readable description of this rule.
-
getDependency
final DependencyNode getDependency()
The dependency to check.
-
getAncestors
final List<DependencyNode> getAncestors()
The ancestors of the dependency in the dependency tree, sorted from farthest to closest: The first entry is the direct dependency of a project, the last entry (at index
level - 1) is a direct parent of this dependency. If the list is empty it means that this dependency is a direct dependency.
-
getLevel
final Integer getLevel()
The level of the dependency inside the dependency tree. Starts with 0 for a direct dependency of a project.
-
getScopeName
final String getScopeName()
The name of the scope that contains the dependency.
-
getProject
final Project getProject()
The Project that contains the dependency.
-
issueSource
String issueSource()
Return a string to be used as Issue.source for issues generated in hint, warning, and error.
-
directDependencies
final List<DependencyNode> directDependencies()
Return the direct dependencies of the dependency.
-
isAtTreeLevel
final RuleMatcher isAtTreeLevel(Integer level)
A RuleMatcher that checks if the level of the dependency inside the dependency tree equals level, which starts with 0 for a direct dependency.
-
isProjectFromOrg
final RuleMatcher isProjectFromOrg(String names)
A RuleMatcher that checks if the identifier of the project belongs to one of the provided orgs.
-
isStaticallyLinked
final RuleMatcher isStaticallyLinked()
A RuleMatcher that checks if the dependency is statically linked.
-
-
-
-