Class ExtractedLicenseInfoSheet

java.lang.Object
org.spdx.spreadsheetstore.AbstractSheet
org.spdx.spreadsheetstore.ExtractedLicenseInfoSheet
Direct Known Subclasses:
ExtractedLicenseInfoSheetV1d1

public abstract class ExtractedLicenseInfoSheet extends AbstractSheet
Abstract class for extracted license info sheet. Specific versions are implemented as subclasses.
Author:
Gary O'Neall
  • Field Details

    • version

      protected String version
  • Constructor Details

    • ExtractedLicenseInfoSheet

      public ExtractedLicenseInfoSheet(org.apache.poi.ss.usermodel.Workbook workbook, String sheetName, String version, org.spdx.storage.IModelStore modelStore, String documentUri, org.spdx.library.ModelCopyManager copyManager)
      Create an ExtractedLicenseInfoSheet instance
      Parameters:
      workbook - Workbook object where the sheet resides.
      sheetName - Sheet name within the workbook.
      version - Spreadsheet format version.
      modelStore - Model store for SPDX objects.
      documentUri - URI of the SPDX document.
      copyManager - Copy manager for SPDX object handling.
  • Method Details

    • openVersion

      public static ExtractedLicenseInfoSheet 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 extracted license info sheet for a specific version
      Parameters:
      workbook - Workbook containing the sheet.
      packageInfoSheetName - Name of the sheet containing package information.
      version - Spreadsheet format version.
      modelStore - Model store for SPDX objects.
      documentUri - URI of the SPDX document.
      copyManager - Copy manager for SPDX object handling.
      Returns:
      An instance of ExtractedLicenseInfoSheet.
    • create

      public static void create(org.apache.poi.ss.usermodel.Workbook wb, String nonStandardLicenseSheetName)
      Create a blank worksheet NOTE: Replaces / deletes existing sheet by the same name
      Parameters:
      wb - Workbook where the sheet will be created.
      nonStandardLicenseSheetName - Name of the sheet to be created.
    • getIdentifier

      public abstract String getIdentifier(int rowNum)
      Retrieve the license identifier for a specific row in the spreadsheet
      Parameters:
      rowNum - Row number in the sheet.
      Returns:
      License identifier.
    • getExtractedText

      public abstract String getExtractedText(int rowNum)
      Retrieve the extracted text for a specific row in the spreadsheet
      Parameters:
      rowNum - Row number in the sheet.
      Returns:
      Extracted license text.
    • add

      public abstract void add(String identifier, String extractedText, String licenseName, Collection<String> crossRefUrls, String comment)
      Add a new row to the NonStandardLicenses sheet
      Parameters:
      identifier - License ID
      extractedText - Extracted license text
      licenseName - optional license name
      crossRefUrls - optional cross reference URL's
      comment - optional comment
    • getLicenseName

      public abstract String getLicenseName(int rowNum)
      Retrieves the license name for a specific row.
      Parameters:
      rowNum - Row number in the sheet.
      Returns:
      License name.
    • getCrossRefUrls

      public abstract Collection<String> getCrossRefUrls(int rowNum)
      Retrieves the cross-reference URLs for a specific row.
      Parameters:
      rowNum - Row number in the sheet.
      Returns:
      A collection of cross-reference URLs.
    • getComment

      public abstract String getComment(int rowNum)
      Retrieves the comment for a specific row.
      Parameters:
      rowNum - Row number in the sheet.
      Returns:
      Comment as a string.