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 void
addDocument
(org.spdx.library.model.v2.SpdxDocument doc) Add all origin information from the documentstatic void
Construct a DocumentInfoSheet in the given workbookabstract String
Retrieve the author comments for the SPDX documentabstract Date
Retrieve the creation date of the SPDX documentRetrieve the list of creators of the SPDX documentprotected Date
getDataCellDateValue
(int colNum) Retrieve the date value of a data cellprotected String
getDataCellStringValue
(int colNum) Retrieve the string value of a data cell.abstract String
Retrieve the license for the SPDX documentprotected org.apache.poi.ss.usermodel.Row
protected org.apache.poi.ss.usermodel.Row
getDataRow
(int rowIndex) abstract String
Retrieve the document comment for the SPDX documentabstract Collection
<String> Set SPDX identifier for the documentabstract String
Retrieve the document nameabstract Collection
<org.spdx.library.model.v2.ExternalDocumentRef> Retrieve the external document refsabstract String
Retrieve the license list version for the SPDX documentabstract String
Retrieve the namespace for the SPDX documentprotected org.apache.poi.ss.usermodel.Cell
getOrCreateDataCell
(int colNum) abstract String
Retrieve the SPDX identifier for the SPDX documentabstract String
Retrieve the SPDX specification version of the SPDX documentstatic DocumentInfoSheet
openVersion
(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 void
setAuthorComments
(String comments) Set the author comments for the SPDX documentabstract void
setCreated
(Date createdDate) Set the created date for the SPDX documentabstract void
setCreatedBy
(Collection<String> createdBys) Set the list of creators of the SPDX documentprotected void
setDataCellDateValue
(int colNum, Date value) Set the date value of a data cell.protected void
setDataCellStringValue
(int colNum, String value) Set the string value of a data cellabstract void
setDataLicense
(String licenseId) Set the license for the SPDX documentabstract void
setDocumentComment
(String docComment) Set the document comment for the SPDX documentabstract void
setDocumentDescribes
(Collection<String> contents) Set the SPDX ID's for content described by this SPDX documentabstract void
setDocumentName
(String documentName) Set the document nameabstract void
setExternalDocumentRefs
(Collection<org.spdx.library.model.v2.ExternalDocumentRef> externalDocumentRefs) Set the external document refsabstract void
setLicenseListVersion
(String licenseVersion) Set the license list version for the SPDX documentabstract void
Set the SPDX identifier for the documentabstract void
setSPDXVersion
(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
DocumentInfoSheet
corresponding 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
-