Package org.spdx.spreadsheetstore
Class SnippetSheet
java.lang.Object
org.spdx.spreadsheetstore.AbstractSheet
org.spdx.spreadsheetstore.SnippetSheet
Represents a sheet that stores information about SPDX snippets
- Author:
- Gary O'Neall
-
Field Summary
Fields inherited from class org.spdx.spreadsheetstore.AbstractSheet
checkboxStyle, CHECKSUM_PATTERN, copyManager, dateStyle, documentUri, firstCellNum, firstRowNum, FONT_SIZE, greenWrapped, lastRowNum, modelStore, redWrapped, sheet, workbook, yellowWrapped
-
Constructor Summary
ConstructorsConstructorDescriptionSnippetSheet
(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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(org.spdx.library.model.v2.SpdxSnippet snippet) Add an SPDX snippet to the spreadsheetstatic void
Create a sheet in the given workbook Create a new sheet in the given workbook with the specified name.org.spdx.library.model.v2.SpdxSnippet
getSnippet
(int rowNum) Get the SPDX snippet represented in the specified row IMPORTANT: The Snippet From File must already be in the model store.getSnippetFileId
(int rowNum) Get the SpdxFromFileSNippet for the given rowverify()
Verifies the integrity of the sheet's dataMethods inherited from class org.spdx.spreadsheetstore.AbstractSheet
addRow, checksumsToString, checksumToString, clear, createCenterStyle, createHeaderStyle, createLeftWrapStyle, csvToStrings, getFirstDataRow, getNumDataRows, getSheet, licensesToString, parseChecksum, resizeRows, stringsToCsv, strToChecksums
-
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
Description copied from class:AbstractSheet
Verifies the integrity of the sheet's data- Specified by:
verify
in classAbstractSheet
- Returns:
- A string describing any issues, or an empty string if valid.
-
create
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
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 thegetSnippetFileId(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
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
-