Class PackageInfoSheet

java.lang.Object
org.spdx.spreadsheetstore.AbstractSheet
org.spdx.spreadsheetstore.PackageInfoSheet
Direct Known Subclasses:
PackageInfoSheetV2d0, PackageInfoSheetV2d1, PackageInfoSheetV2d2, PackageInfoSheetV2d3

public abstract class PackageInfoSheet extends AbstractSheet
Abstract PackageInfoSheet to manage cross-version implementations
Author:
Gary O'Neall
  • Field Details

    • version

      protected String version
  • Constructor Details

    • PackageInfoSheet

      public PackageInfoSheet(org.apache.poi.ss.usermodel.Workbook workbook, String sheetName, String version, org.spdx.storage.IModelStore modelStore, String documentUri, org.spdx.library.ModelCopyManager copyManager)
      Constructs a new PackageInfoSheet
      Parameters:
      workbook - the workbook containing the sheet
      sheetName - the name of the sheet
      version - the version of the sheet
      modelStore - the model store to use
      documentUri - the URI of the document
      copyManager - the copy manager to use
  • Method Details

    • openVersion

      public static PackageInfoSheet openVersion(org.apache.poi.ss.usermodel.Workbook workbook, String packageInfoSheetName, String version, org.spdx.storage.IModelStore modelStore, String documentUri, org.spdx.library.ModelCopyManager copyManager)
      Opens an existing PackageInfoSheet
      Parameters:
      workbook - the workbook containing the sheet
      packageInfoSheetName - the name of the sheet
      version - the version of the sheet
      modelStore - the model store to use
      documentUri - the URI of the document
      copyManager - the copy manager to use
      Returns:
      the opened PackageInfoSheet
    • create

      public static void create(org.apache.poi.ss.usermodel.Workbook wb, String sheetName)
      Creates a new PackageInfoSheet in the provided workbook with the specified sheet name
      Parameters:
      wb - the workbook where the sheet will be created
      sheetName - the name of the sheet to be created
    • getPackages

      public abstract List<org.spdx.library.model.v2.SpdxPackage> getPackages() throws SpreadsheetException, org.spdx.core.DefaultStoreNotInitializedException
      Retrieves a list of SPDX packages from the sheet
      Returns:
      a list of SPDX packages
      Throws:
      SpreadsheetException - if there is an error reading the spreadsheet
      org.spdx.core.DefaultStoreNotInitializedException - if the model store is not initialized
    • add

      public abstract void add(org.spdx.library.model.v2.SpdxPackage pkgInfo) throws org.spdx.core.InvalidSPDXAnalysisException
      Adds a new SPDX package to the sheet
      Parameters:
      pkgInfo - the SPDX package to add
      Throws:
      org.spdx.core.InvalidSPDXAnalysisException - if there is an error with the SPDX analysis