Class SnippetSheet

java.lang.Object
org.spdx.spreadsheetstore.AbstractSheet
org.spdx.spreadsheetstore.SnippetSheet

public class SnippetSheet extends AbstractSheet
Represents a sheet that stores information about SPDX snippets
Author:
Gary O'Neall
  • Constructor Details

    • SnippetSheet

      public SnippetSheet(org.apache.poi.ss.usermodel.Workbook workbook, String snippetSheetName, org.spdx.storage.IModelStore modelStore, String documentUri, org.spdx.library.ModelCopyManager copyManager)
      Construct a new SnippetSheet instance
      Parameters:
      workbook - The Workbook object.
      snippetSheetName - The name of the sheet within the workbook where snippet data is stored.
      modelStore - The model store used to manage SPDX objects.
      documentUri - The URI of the SPDX document associated with this sheet.
      copyManager - The copy manager used for handling SPDX object copies.
  • Method Details

    • verify

      public String verify()
      Description copied from class: AbstractSheet
      Verifies the integrity of the sheet's data
      Specified by:
      verify in class AbstractSheet
      Returns:
      A string describing any issues, or an empty string if valid.
    • create

      public static void create(org.apache.poi.ss.usermodel.Workbook wb, String sheetName)
      Create a sheet in the given workbook Create a new sheet in the given workbook with the specified name. If a sheet with the given name already exists, it will be removed and replaced with a new one.
      Parameters:
      wb - The Workbook object where the sheet will be created.
      sheetName - The name of the sheet to be created.
    • add

      public void add(org.spdx.library.model.v2.SpdxSnippet snippet) throws SpreadsheetException
      Add an SPDX snippet to the spreadsheet
      Parameters:
      snippet -
      Throws:
      SpreadsheetException
    • getSnippet

      @Nullable public org.spdx.library.model.v2.SpdxSnippet getSnippet(int rowNum) throws SpreadsheetException, org.spdx.core.DefaultStoreNotInitializedException
      Get the SPDX snippet represented in the specified row IMPORTANT: The Snippet From File must already be in the model store. The ID from the Snippet From File can be obtained through the getSnippetFileId(int rowNum) method
      Parameters:
      rowNum -
      Returns:
      Snippet at the row rowNum or null if the row does not exist
      Throws:
      SpreadsheetException
      org.spdx.core.DefaultStoreNotInitializedException
    • getSnippetFileId

      public String getSnippetFileId(int rowNum) throws SpreadsheetException
      Get the SpdxFromFileSNippet for the given row
      Parameters:
      rowNum -
      Returns:
      The ID of the "Snippet From File" for the specified row, or null if the row does not exist.
      Throws:
      SpreadsheetException