Class XmlLicenseProvider

java.lang.Object
org.spdx.licensexml.XmlLicenseProvider
All Implemented Interfaces:
ISpdxListedLicenseProvider
Direct Known Subclasses:
XmlLicenseProviderWithCrossRefDetails

public class XmlLicenseProvider extends Object implements ISpdxListedLicenseProvider
Provide license information from XML files
Author:
Gary O'Neall
  • Field Details

    • warnings

      protected List<String> warnings
    • v2ModelStore

      protected org.spdx.storage.IModelStore v2ModelStore
    • v3ModelStore

      protected org.spdx.storage.IModelStore v3ModelStore
    • copyManager

      protected org.spdx.core.IModelCopyManager copyManager
    • releaseDate

      protected String releaseDate
    • currentListVersion

      protected String currentListVersion
    • creationInfo

      protected org.spdx.library.model.v3_0_1.core.CreationInfo creationInfo
  • Constructor Details

    • XmlLicenseProvider

      public XmlLicenseProvider(File xmlFileDirectory, String currentListVersion, String releaseDate) throws org.spdx.core.InvalidSPDXAnalysisException
      Parameters:
      xmlFileDirectory - directory of XML files
      currentListVersion - version of the license list to include the license data
      releaseDate - Date the license list is released
      Throws:
      org.spdx.core.InvalidSPDXAnalysisException - on error creating licenses or creationInfo
  • Method Details

    • createCreationInfo

      public static org.spdx.library.model.v3_0_1.core.CreationInfo createCreationInfo(org.spdx.storage.IModelStore modelStore, @Nullable org.spdx.core.IModelCopyManager copyManager, String listCreationDate, String licenseListVersion) throws org.spdx.core.InvalidSPDXAnalysisException
      Parameters:
      modelStore - Store to store the CreationInfo
      copyManager - Optional copyManager
      listCreationDate - Date the license list was created
      licenseListVersion - Version of the license list
      Returns:
      the creationInfo intended for use in licensing data
      Throws:
      org.spdx.core.InvalidSPDXAnalysisException - on error creating the creation info
    • getLicenseIterator

      public Iterator<ListedLicenseContainer> getLicenseIterator() throws org.spdx.library.model.v2.license.SpdxListedLicenseException
      Specified by:
      getLicenseIterator in interface ISpdxListedLicenseProvider
      Throws:
      org.spdx.library.model.v2.license.SpdxListedLicenseException
    • getExceptionIterator

      public Iterator<ListedExceptionContainer> getExceptionIterator() throws org.spdx.core.InvalidSPDXAnalysisException
      Specified by:
      getExceptionIterator in interface ISpdxListedLicenseProvider
      Throws:
      org.spdx.core.InvalidSPDXAnalysisException
    • getWarnings

      public List<String> getWarnings()
      Specified by:
      getWarnings in interface ISpdxListedLicenseProvider