Package org.spdx.library.model.license
Class ListedLicenses
java.lang.Object
org.spdx.library.model.license.ListedLicenses
public class ListedLicenses extends Object
Singleton class which holds the listed licenses
- Author:
- Gary O'Neall
-
Method Summary
Modifier and Type Method Description StringgetLicenseListVersion()IModelStoregetLicenseModelStore()ListedLicenseExceptiongetListedExceptionById(String exceptionId)SpdxListedLicensegetListedLicenseById(String licenseId)static ListedLicensesgetListedLicenses()List<String>getSpdxListedExceptionIds()List<String>getSpdxListedLicenseIds()booleanisSpdxListedExceptionId(String exceptionId)booleanisSpdxListedLicenseId(String licenseId)Optional<String>listedExceptionIdCaseSensitive(String exceptionId)Optional<String>listedLicenseIdCaseSensitive(String licenseId)static ListedLicensesresetListedLicenses()Resets all of the cached license information and reloads the license IDs NOTE: This method should be used with caution, it will negatively impact performance.
-
Method Details
-
getListedLicenses
-
resetListedLicenses
Resets all of the cached license information and reloads the license IDs NOTE: This method should be used with caution, it will negatively impact performance.- Returns:
-
isSpdxListedLicenseId
- Parameters:
licenseId- case insensitive- Returns:
- true if the licenseId belongs to an SPDX listed license
-
isSpdxListedExceptionId
- Parameters:
exceptionId- case insensitive- Returns:
- true if the exceptionId belongs to an SPDX listed exception
-
getListedLicenseById
public SpdxListedLicense getListedLicenseById(String licenseId) throws InvalidSPDXAnalysisException- Parameters:
licenseId- SPDX Listed License ID- Returns:
- SPDX listed license or null if the ID is not in the SPDX license list
- Throws:
InvalidSPDXAnalysisException
-
getListedExceptionById
public ListedLicenseException getListedExceptionById(String exceptionId) throws InvalidSPDXAnalysisException- Throws:
InvalidSPDXAnalysisException
-
getSpdxListedLicenseIds
- Returns:
- List of all SPDX listed license IDs
-
getLicenseListVersion
- Returns:
- The version of the loaded license list in the form M.N, where M is the major release and N is the minor release.
If no license list is loaded, returns
SpdxListedLicenseModelStore.DEFAULT_LICENSE_LIST_VERSION.
-
getSpdxListedExceptionIds
- Returns:
- list of SPDX exception IDs
-
listedLicenseIdCaseSensitive
- Parameters:
licenseId- case insensitive license ID- Returns:
- the case sensitive license ID
-
listedExceptionIdCaseSensitive
- Parameters:
exceptionId- case insensitive exception ID- Returns:
- case sensitive ID
-
getLicenseModelStore
- Returns:
- model store for listed licenses
-