Class ResolvedLicenseInfo
-
- All Implemented Interfaces:
-
kotlin.collections.Iterable
public final class ResolvedLicenseInfo implements Iterable<ResolvedLicense>
Resolved license information about a package (or project).
-
-
Field Summary
Fields Modifier and Type Field Description private final Identifieridprivate final LicenseInfolicenseInfoprivate final List<ResolvedLicense>licensesprivate final Map<Provenance, Set<CopyrightFinding>>copyrightGarbageprivate final Map<Provenance, Set<ResolvedCopyrightFinding>>unmatchedCopyrights
-
Constructor Summary
Constructors Constructor Description ResolvedLicenseInfo(Identifier id, LicenseInfo licenseInfo, List<ResolvedLicense> licenses, Map<Provenance, Set<CopyrightFinding>> copyrightGarbage, Map<Provenance, Set<ResolvedCopyrightFinding>> unmatchedCopyrights)
-
Method Summary
Modifier and Type Method Description final IdentifiergetId()The identifier of the package (or project). final LicenseInfogetLicenseInfo()The unresolved license info. final List<ResolvedLicense>getLicenses()The list of ResolvedLicenses for this package (or project). final Map<Provenance, Set<CopyrightFinding>>getCopyrightGarbage()All copyright findings with statements that are contained in CopyrightGarbage, mapped to the Provenance where they were detected. final Map<Provenance, Set<ResolvedCopyrightFinding>>getUnmatchedCopyrights()All copyright findings that could not be matched to a license finding, mapped to the Provenance where they were detected. final ResolvedLicenseget(SpdxSingleLicenseExpression license)final SpdxExpressioneffectiveLicense(LicenseView licenseView, List<SpdxLicenseChoice> licenseChoices)Return the effective SpdxExpression of this ResolvedLicenseInfo based on their licenses filtered by the licenseView and the applied licenseChoices. final Set<String>getCopyrights(Boolean process, Boolean omitExcluded)Return all copyright statements associated to this license info. final Set<String>getCopyrights(Boolean process)Return all copyright statements associated to this license info. final Set<String>getCopyrights()Return all copyright statements associated to this license info. final ResolvedLicenseInfofilter(LicenseView licenseView, Boolean filterSources)Call LicenseView.filter on this ResolvedLicenseInfo. final ResolvedLicenseInfofilter(LicenseView licenseView)Call LicenseView.filter on this ResolvedLicenseInfo. final List<ResolvedLicense>filter(Provenance provenance, String path)Filter all licenses that have a location matching provenance and path. final ResolvedLicenseInfoapplyChoices(List<SpdxLicenseChoice> licenseChoices, LicenseView licenseView)Apply licenseChoices on the effective license of the licenseView. final ResolvedLicenseInfofilterExcluded()Filter all excluded licenses and copyrights. -
-
Constructor Detail
-
ResolvedLicenseInfo
ResolvedLicenseInfo(Identifier id, LicenseInfo licenseInfo, List<ResolvedLicense> licenses, Map<Provenance, Set<CopyrightFinding>> copyrightGarbage, Map<Provenance, Set<ResolvedCopyrightFinding>> unmatchedCopyrights)
-
-
Method Detail
-
getId
final Identifier getId()
The identifier of the package (or project).
-
getLicenseInfo
final LicenseInfo getLicenseInfo()
The unresolved license info.
-
getLicenses
final List<ResolvedLicense> getLicenses()
The list of ResolvedLicenses for this package (or project).
-
getCopyrightGarbage
final Map<Provenance, Set<CopyrightFinding>> getCopyrightGarbage()
All copyright findings with statements that are contained in CopyrightGarbage, mapped to the Provenance where they were detected.
-
getUnmatchedCopyrights
final Map<Provenance, Set<ResolvedCopyrightFinding>> getUnmatchedCopyrights()
All copyright findings that could not be matched to a license finding, mapped to the Provenance where they were detected.
-
get
final ResolvedLicense get(SpdxSingleLicenseExpression license)
-
effectiveLicense
final SpdxExpression effectiveLicense(LicenseView licenseView, List<SpdxLicenseChoice> licenseChoices)
Return the effective SpdxExpression of this ResolvedLicenseInfo based on their licenses filtered by the licenseView and the applied licenseChoices. Effective, in this context, refers to an SpdxExpression that can be used as a final license of this ResolvedLicenseInfo. licenseChoices will be applied in the order they are given to the function.
-
getCopyrights
@JvmOverloads() final Set<String> getCopyrights(Boolean process, Boolean omitExcluded)
Return all copyright statements associated to this license info. Copyright findings that are excluded by PathExcludes are omitted by default. The copyrights are processed by default using the CopyrightStatementsProcessor.
-
getCopyrights
@JvmOverloads() final Set<String> getCopyrights(Boolean process)
Return all copyright statements associated to this license info. Copyright findings that are excluded by PathExcludes are omitted by default. The copyrights are processed by default using the CopyrightStatementsProcessor.
-
getCopyrights
@JvmOverloads() final Set<String> getCopyrights()
Return all copyright statements associated to this license info. Copyright findings that are excluded by PathExcludes are omitted by default. The copyrights are processed by default using the CopyrightStatementsProcessor.
-
filter
@JvmOverloads() final ResolvedLicenseInfo filter(LicenseView licenseView, Boolean filterSources)
Call LicenseView.filter on this ResolvedLicenseInfo.
-
filter
@JvmOverloads() final ResolvedLicenseInfo filter(LicenseView licenseView)
Call LicenseView.filter on this ResolvedLicenseInfo.
-
filter
final List<ResolvedLicense> filter(Provenance provenance, String path)
Filter all licenses that have a location matching provenance and path.
-
applyChoices
final ResolvedLicenseInfo applyChoices(List<SpdxLicenseChoice> licenseChoices, LicenseView licenseView)
Apply licenseChoices on the effective license of the licenseView.
-
filterExcluded
final ResolvedLicenseInfo filterExcluded()
Filter all excluded licenses and copyrights. Licenses are removed if they are only detected and all locations have matching path excludes. Copyrights are removed if all findings have matching path excludes.
-
-
-
-