Class LicenseView
-
- All Implemented Interfaces:
public final class LicenseViewA LicenseView provides a custom view on the licenses that belong to a Package. It can be used to filter the licenses relevant to an evaluator rule whereas the licenseSources is the filter criteria. Only the entry with the lowest index in the given licenseSources which yields a non-empty result is used as filter criteria.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classLicenseView.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static LicenseView.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description LicenseView(Set<LicenseSource> licenseSources)
-
Method Summary
Modifier and Type Method Description final ResolvedLicenseInfofilter(ResolvedLicenseInfo resolvedLicense, Boolean filterSources)Use this LicenseView to filter a ResolvedLicenseInfo. final ResolvedLicenseInfofilter(ResolvedLicenseInfo resolvedLicense)Use this LicenseView to filter a ResolvedLicenseInfo. final List<ResolvedLicense>filter(List<ResolvedLicense> resolvedLicenses, Boolean filterSources)Use this LicenseView to filter a list of ResolvedLicenses. final List<ResolvedLicense>filter(List<ResolvedLicense> resolvedLicenses)Use this LicenseView to filter a list of ResolvedLicenses. final ResolvedLicenseInfofilter(ResolvedLicenseInfo resolvedLicenseInfo, List<SpdxLicenseChoice> licenseChoices, Boolean filterSources)Use this LicenseView to filter a ResolvedLicenseInfo. final ResolvedLicenseInfofilter(ResolvedLicenseInfo resolvedLicenseInfo, List<SpdxLicenseChoice> licenseChoices)Use this LicenseView to filter a ResolvedLicenseInfo. -
-
Constructor Detail
-
LicenseView
LicenseView(Set<LicenseSource> licenseSources)
-
-
Method Detail
-
filter
@JvmOverloads() final ResolvedLicenseInfo filter(ResolvedLicenseInfo resolvedLicense, Boolean filterSources)
Use this LicenseView to filter a ResolvedLicenseInfo. This function will filter the ResolvedLicenses based on the configured LicenseSources, but it will not remove information from other sources. For example, if ONLY_CONCLUDED is used, it will remove all ResolvedLicenses that do not have LicenseSource.CONCLUDED in their sources, but it will not remove any information about declared or detected licenses from the ResolvedLicense object. This is so, because even if only concluded licenses are requested, it can still be required to access the detected locations or copyrights for the licenses. This function only changes ResolvedLicenseInfo.licenses, all other properties of the class are kept unchanged.
If filterSources is true, only the license sources are kept that caused the ResolvedLicense to be part of the result. Otherwise all original license sources are kept.
-
filter
@JvmOverloads() final ResolvedLicenseInfo filter(ResolvedLicenseInfo resolvedLicense)
Use this LicenseView to filter a ResolvedLicenseInfo. This function will filter the ResolvedLicenses based on the configured LicenseSources, but it will not remove information from other sources. For example, if ONLY_CONCLUDED is used, it will remove all ResolvedLicenses that do not have LicenseSource.CONCLUDED in their sources, but it will not remove any information about declared or detected licenses from the ResolvedLicense object. This is so, because even if only concluded licenses are requested, it can still be required to access the detected locations or copyrights for the licenses. This function only changes ResolvedLicenseInfo.licenses, all other properties of the class are kept unchanged.
If filterSources is true, only the license sources are kept that caused the ResolvedLicense to be part of the result. Otherwise all original license sources are kept.
-
filter
@JvmOverloads() final List<ResolvedLicense> filter(List<ResolvedLicense> resolvedLicenses, Boolean filterSources)
Use this LicenseView to filter a list of ResolvedLicenses. This function will filter the licenses based on the configured LicenseSources, but it will not remove information from other sources. For example, if ONLY_CONCLUDED is used, it will remove all ResolvedLicenses that do not have LicenseSource.CONCLUDED in their sources, but it will not remove any information about declared or detected licenses from the ResolvedLicense object. This is so, because even if only concluded licenses are requested, it can still be required to access the detected locations or copyrights for the licenses.
If filterSources is true, only the license sources are kept that caused the ResolvedLicense to be part of the result. Otherwise all original license sources are kept.
-
filter
@JvmOverloads() final List<ResolvedLicense> filter(List<ResolvedLicense> resolvedLicenses)
Use this LicenseView to filter a list of ResolvedLicenses. This function will filter the licenses based on the configured LicenseSources, but it will not remove information from other sources. For example, if ONLY_CONCLUDED is used, it will remove all ResolvedLicenses that do not have LicenseSource.CONCLUDED in their sources, but it will not remove any information about declared or detected licenses from the ResolvedLicense object. This is so, because even if only concluded licenses are requested, it can still be required to access the detected locations or copyrights for the licenses.
If filterSources is true, only the license sources are kept that caused the ResolvedLicense to be part of the result. Otherwise all original license sources are kept.
-
filter
@JvmOverloads() final ResolvedLicenseInfo filter(ResolvedLicenseInfo resolvedLicenseInfo, List<SpdxLicenseChoice> licenseChoices, Boolean filterSources)
Use this LicenseView to filter a ResolvedLicenseInfo. This function will filter the ResolvedLicenses based on the configured LicenseSources, but it will not remove information from other sources. For example, if ONLY_CONCLUDED is used, it will remove all ResolvedLicenses that do not have LicenseSource.CONCLUDED in their sources, but it will not remove any information about declared or detected licenses from the ResolvedLicense object. This is so, because even if only concluded licenses are requested, it can still be required to access the detected locations or copyrights for the licenses. This function only changes ResolvedLicenseInfo.licenses, all other properties of the class are kept unchanged.
If filterSources is true, only the license sources are kept that caused the ResolvedLicense to be part of the result. Otherwise all original license sources are kept.
Additionally, the licenseChoices are applied, removing all licenses that were not chosen from the ResolvedLicenseInfo. The information is still obtainable through the ResolvedLicense.originalExpressions.
-
filter
@JvmOverloads() final ResolvedLicenseInfo filter(ResolvedLicenseInfo resolvedLicenseInfo, List<SpdxLicenseChoice> licenseChoices)
Use this LicenseView to filter a ResolvedLicenseInfo. This function will filter the ResolvedLicenses based on the configured LicenseSources, but it will not remove information from other sources. For example, if ONLY_CONCLUDED is used, it will remove all ResolvedLicenses that do not have LicenseSource.CONCLUDED in their sources, but it will not remove any information about declared or detected licenses from the ResolvedLicense object. This is so, because even if only concluded licenses are requested, it can still be required to access the detected locations or copyrights for the licenses. This function only changes ResolvedLicenseInfo.licenses, all other properties of the class are kept unchanged.
If filterSources is true, only the license sources are kept that caused the ResolvedLicense to be part of the result. Otherwise all original license sources are kept.
Additionally, the licenseChoices are applied, removing all licenses that were not chosen from the ResolvedLicenseInfo. The information is still obtainable through the ResolvedLicense.originalExpressions.
-
-
-
-