Class DocumentInfoSheet

java.lang.Object
org.spdx.spreadsheetstore.AbstractSheet
org.spdx.spreadsheetstore.DocumentInfoSheet
Direct Known Subclasses:
DocumentInfoSheetV2d0

public abstract class DocumentInfoSheet extends AbstractSheet
Abstract class for sheet containing information about the origins of an SPDX document Specific versions implemented as subclasses
Author:
Gary O'Neall
  • Field Details

    • version

      protected String 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 created
      sheetName - Sheet name
      documentUri - 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 version
      modelStore - Model store for the SPDX document
      copyManager - 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

      protected void setDataCellStringValue(int colNum, String value)
      Set the string value of a data cell
      Parameters:
      colNum - Cell column number.
      value - String value to set.
    • setDataCellDateValue

      protected void setDataCellDateValue(int colNum, Date value)
      Set the date value of a data cell.
      Parameters:
      colNum - Cell column number.
      value - Date value to set.
    • getDataCellDateValue

      protected Date getDataCellDateValue(int colNum)
      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

      protected String getDataCellStringValue(int colNum)
      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

      public abstract void setSPDXVersion(String spdxVersion)
      Set the SPDX specification version for the SPDX document
      Parameters:
      spdxVersion - SPDX specification version
    • setCreatedBy

      public abstract void setCreatedBy(Collection<String> createdBys)
      Set the list of creators of the SPDX document
      Parameters:
      createdBys - List of creators
    • setDataLicense

      public abstract void setDataLicense(String licenseId)
      Set the license for the SPDX document
      Parameters:
      licenseId - License ID
    • setAuthorComments

      public abstract void setAuthorComments(String comments)
      Set the author comments for the SPDX document
      Parameters:
      comments - Author comments
    • setCreated

      public abstract void setCreated(Date createdDate)
      Set the created date for the SPDX document
      Parameters:
      createdDate - Created date
    • getCreated

      public abstract Date getCreated()
      Retrieve the creation date of the SPDX document
      Returns:
      Date the SPDX document was created
    • getCreatedBy

      public abstract List<String> getCreatedBy()
      Retrieve the list of creators of the SPDX document
      Returns:
      List of creators
    • getAuthorComments

      public abstract String getAuthorComments()
      Retrieve the author comments for the SPDX document
      Returns:
      Author comments
    • getSPDXVersion

      public abstract String getSPDXVersion()
      Retrieve the SPDX specification version of the SPDX document
      Returns:
      SPDX specification version
    • getDataLicense

      public abstract String getDataLicense()
      Retrieve the license for the SPDX document
      Returns:
      License ID
    • getDocumentComment

      public abstract String getDocumentComment()
      Retrieve the document comment for the SPDX document
      Returns:
      Document comment
    • setDocumentComment

      public abstract void setDocumentComment(String docComment)
      Set the document comment for the SPDX document
      Parameters:
      docComment - Document comment
    • getLicenseListVersion

      public abstract String getLicenseListVersion()
      Retrieve the license list version for the SPDX document
      Returns:
      License list version
    • setLicenseListVersion

      public abstract void setLicenseListVersion(String licenseVersion)
      Set the license list version for the SPDX document
      Parameters:
      licenseVersion - License list version
    • getNamespace

      public abstract String 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

      public abstract String getSpdxId()
      Retrieve the SPDX identifier for the SPDX document
      Returns:
      SPDX identifier for the document
    • setSpdxId

      public abstract void setSpdxId(String id)
      Set the SPDX identifier for the document
      Parameters:
      id - SPDX identifier
    • getDocumentName

      public abstract String getDocumentName()
      Retrieve the document name
      Returns:
      Document name
    • setDocumentName

      public abstract void setDocumentName(String documentName)
      Set the document name
      Parameters:
      documentName - Document name
    • getDocumentContents

      public abstract Collection<String> getDocumentContents()
      Set SPDX identifier for the document
      Returns:
      SPDX ID's for content described by this SPDX document
    • setDocumentDescribes

      public abstract void setDocumentDescribes(Collection<String> contents)
      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 SpreadsheetException
      Retrieve 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