Package org.spdx.spreadsheetstore
Class ExtractedLicenseInfoSheet
java.lang.Object
org.spdx.spreadsheetstore.AbstractSheet
org.spdx.spreadsheetstore.ExtractedLicenseInfoSheet
- Direct Known Subclasses:
ExtractedLicenseInfoSheetV1d1
Abstract class for extracted license info sheet. Specific versions are implemented as subclasses.
- Author:
- Gary O'Neall
-
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionExtractedLicenseInfoSheet(org.apache.poi.ss.usermodel.Workbook workbook, String sheetName, String version, org.spdx.storage.IModelStore modelStore, String documentUri, org.spdx.library.ModelCopyManager copyManager) Create anExtractedLicenseInfoSheetinstance -
Method Summary
Modifier and TypeMethodDescriptionabstract voidadd(String identifier, String extractedText, String licenseName, Collection<String> crossRefUrls, String comment) Add a new row to the NonStandardLicenses sheetstatic voidCreate a blank worksheet NOTE: Replaces / deletes existing sheet by the same nameabstract StringgetComment(int rowNum) Retrieves the comment for a specific row.abstract Collection<String> getCrossRefUrls(int rowNum) Retrieves the cross-reference URLs for a specific row.abstract StringgetExtractedText(int rowNum) Retrieve the extracted text for a specific row in the spreadsheetabstract StringgetIdentifier(int rowNum) Retrieve the license identifier for a specific row in the spreadsheetabstract StringgetLicenseName(int rowNum) Retrieves the license name for a specific row.static ExtractedLicenseInfoSheetopenVersion(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 versionMethods inherited from class org.spdx.spreadsheetstore.AbstractSheet
addRow, checksumsToString, checksumToString, clear, createCenterStyle, createHeaderStyle, createLeftWrapStyle, csvToStrings, getFirstDataRow, getNumDataRows, getSheet, licensesToString, parseChecksum, resizeRows, stringsToCsv, strToChecksums, verify
-
Field Details
-
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 anExtractedLicenseInfoSheetinstance- 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
Retrieve the license identifier for a specific row in the spreadsheet- Parameters:
rowNum- Row number in the sheet.- Returns:
- License identifier.
-
getExtractedText
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 IDextractedText- Extracted license textlicenseName- optional license namecrossRefUrls- optional cross reference URL'scomment- optional comment
-
getLicenseName
Retrieves the license name for a specific row.- Parameters:
rowNum- Row number in the sheet.- Returns:
- License name.
-
getCrossRefUrls
Retrieves the cross-reference URLs for a specific row.- Parameters:
rowNum- Row number in the sheet.- Returns:
- A collection of cross-reference URLs.
-
getComment
Retrieves the comment for a specific row.- Parameters:
rowNum- Row number in the sheet.- Returns:
- Comment as a string.
-