Package org.spdx.spreadsheetstore
Class DocumentInfoSheet
java.lang.Object
org.spdx.spreadsheetstore.AbstractSheet
org.spdx.spreadsheetstore.DocumentInfoSheet
- Direct Known Subclasses:
DocumentInfoSheetV2d0
Abstract class for sheet containing information about the origins of an SPDX document
Specific versions 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
ConstructorsConstructorDescriptionDocumentInfoSheet(org.apache.poi.ss.usermodel.Workbook workbook, String sheetName, String version, org.spdx.storage.IModelStore modelStore, org.spdx.library.ModelCopyManager copyManager) -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaddDocument(org.spdx.library.model.v2.SpdxDocument doc) Add all origin information from the documentstatic voidConstruct a DocumentInfoSheet in the given workbookabstract StringRetrieve the author comments for the SPDX documentabstract DateRetrieve the creation date of the SPDX documentRetrieve the list of creators of the SPDX documentprotected DategetDataCellDateValue(int colNum) Retrieve the date value of a data cellprotected StringgetDataCellStringValue(int colNum) Retrieve the string value of a data cell.abstract StringRetrieve the license for the SPDX documentprotected org.apache.poi.ss.usermodel.Rowprotected org.apache.poi.ss.usermodel.RowgetDataRow(int rowIndex) abstract StringRetrieve the document comment for the SPDX documentabstract Collection<String> Set SPDX identifier for the documentabstract StringRetrieve the document nameabstract Collection<org.spdx.library.model.v2.ExternalDocumentRef> Retrieve the external document refsabstract StringRetrieve the license list version for the SPDX documentabstract StringRetrieve the namespace for the SPDX documentprotected org.apache.poi.ss.usermodel.CellgetOrCreateDataCell(int colNum) abstract StringRetrieve the SPDX identifier for the SPDX documentabstract StringRetrieve the SPDX specification version of the SPDX documentstatic DocumentInfoSheetopenVersion(org.apache.poi.ss.usermodel.Workbook workbook, String originSheetName, String version, org.spdx.storage.IModelStore modelStore, org.spdx.library.ModelCopyManager copyManager) Open an existing worksheetabstract voidsetAuthorComments(String comments) Set the author comments for the SPDX documentabstract voidsetCreated(Date createdDate) Set the created date for the SPDX documentabstract voidsetCreatedBy(Collection<String> createdBys) Set the list of creators of the SPDX documentprotected voidsetDataCellDateValue(int colNum, Date value) Set the date value of a data cell.protected voidsetDataCellStringValue(int colNum, String value) Set the string value of a data cellabstract voidsetDataLicense(String licenseId) Set the license for the SPDX documentabstract voidsetDocumentComment(String docComment) Set the document comment for the SPDX documentabstract voidsetDocumentDescribes(Collection<String> contents) Set the SPDX ID's for content described by this SPDX documentabstract voidsetDocumentName(String documentName) Set the document nameabstract voidsetExternalDocumentRefs(Collection<org.spdx.library.model.v2.ExternalDocumentRef> externalDocumentRefs) Set the external document refsabstract voidsetLicenseListVersion(String licenseVersion) Set the license list version for the SPDX documentabstract voidSet the SPDX identifier for the documentabstract voidsetSPDXVersion(String spdxVersion) Set the SPDX specification version for the SPDX documentMethods 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
-
DocumentInfoSheet
public DocumentInfoSheet(org.apache.poi.ss.usermodel.Workbook workbook, String sheetName, String version, org.spdx.storage.IModelStore modelStore, org.spdx.library.ModelCopyManager copyManager) throws SpreadsheetException - Throws:
SpreadsheetException
-
-
Method Details
-
create
public static void create(org.apache.poi.ss.usermodel.Workbook wb, String sheetName, String documentUri) Construct a DocumentInfoSheet in the given workbook- Parameters:
wb- The Workbook object where the sheet will be createdsheetName- Sheet namedocumentUri- Document URI
-
openVersion
public static DocumentInfoSheet openVersion(org.apache.poi.ss.usermodel.Workbook workbook, String originSheetName, String version, org.spdx.storage.IModelStore modelStore, org.spdx.library.ModelCopyManager copyManager) throws SpreadsheetException Open an existing worksheet- Parameters:
workbook- Workbook object containing the sheet.originSheetName- Name of the sheet to be opened.version- Spreadsheet versionmodelStore- Model store for the SPDX documentcopyManager- The copy manager used for handling SPDX object copies.- Returns:
- An instance of
DocumentInfoSheetcorresponding to the specified version. - Throws:
SpreadsheetException- If the sheet cannot be opened or the version is unsupported.
-
getDataRow
protected org.apache.poi.ss.usermodel.Row getDataRow() -
getDataRow
protected org.apache.poi.ss.usermodel.Row getDataRow(int rowIndex) -
getOrCreateDataCell
protected org.apache.poi.ss.usermodel.Cell getOrCreateDataCell(int colNum) -
setDataCellStringValue
Set the string value of a data cell- Parameters:
colNum- Cell column number.value- String value to set.
-
setDataCellDateValue
Set the date value of a data cell.- Parameters:
colNum- Cell column number.value- Date value to set.
-
getDataCellDateValue
Retrieve the date value of a data cell- Parameters:
colNum- Cell column number.- Returns:
- Date value of the cell, or null if the cell is empty.
-
getDataCellStringValue
Retrieve the string value of a data cell.- Parameters:
colNum- Cell column number.- Returns:
- String value of the cell, or null if the cell is empty.
-
setSPDXVersion
Set the SPDX specification version for the SPDX document- Parameters:
spdxVersion- SPDX specification version
-
setCreatedBy
Set the list of creators of the SPDX document- Parameters:
createdBys- List of creators
-
setDataLicense
Set the license for the SPDX document- Parameters:
licenseId- License ID
-
setAuthorComments
Set the author comments for the SPDX document- Parameters:
comments- Author comments
-
setCreated
Set the created date for the SPDX document- Parameters:
createdDate- Created date
-
getCreated
Retrieve the creation date of the SPDX document- Returns:
- Date the SPDX document was created
-
getCreatedBy
Retrieve the list of creators of the SPDX document- Returns:
- List of creators
-
getAuthorComments
Retrieve the author comments for the SPDX document- Returns:
- Author comments
-
getSPDXVersion
Retrieve the SPDX specification version of the SPDX document- Returns:
- SPDX specification version
-
getDataLicense
Retrieve the license for the SPDX document- Returns:
- License ID
-
getDocumentComment
Retrieve the document comment for the SPDX document- Returns:
- Document comment
-
setDocumentComment
Set the document comment for the SPDX document- Parameters:
docComment- Document comment
-
getLicenseListVersion
Retrieve the license list version for the SPDX document- Returns:
- License list version
-
setLicenseListVersion
Set the license list version for the SPDX document- Parameters:
licenseVersion- License list version
-
getNamespace
Retrieve the namespace for the SPDX document- Returns:
- Namespace
-
addDocument
public abstract void addDocument(org.spdx.library.model.v2.SpdxDocument doc) throws SpreadsheetException Add all origin information from the document- Parameters:
doc- SPDX document to add- Throws:
SpreadsheetException
-
getSpdxId
Retrieve the SPDX identifier for the SPDX document- Returns:
- SPDX identifier for the document
-
setSpdxId
Set the SPDX identifier for the document- Parameters:
id- SPDX identifier
-
getDocumentName
Retrieve the document name- Returns:
- Document name
-
setDocumentName
Set the document name- Parameters:
documentName- Document name
-
getDocumentContents
Set SPDX identifier for the document- Returns:
- SPDX ID's for content described by this SPDX document
-
setDocumentDescribes
Set the SPDX ID's for content described by this SPDX document- Parameters:
contents- SPDX ID's for content described by this SPDX document
-
getExternalDocumentRefs
public abstract Collection<org.spdx.library.model.v2.ExternalDocumentRef> getExternalDocumentRefs() throws SpreadsheetExceptionRetrieve the external document refs- Returns:
- External document refs
- Throws:
SpreadsheetException
-
setExternalDocumentRefs
public abstract void setExternalDocumentRefs(Collection<org.spdx.library.model.v2.ExternalDocumentRef> externalDocumentRefs) throws SpreadsheetException Set the external document refs- Parameters:
externalDocumentRefs-- Throws:
SpreadsheetException
-