Class SpreadsheetStore

java.lang.Object
org.spdx.storage.simple.ExtendedSpdxStore
org.spdx.spreadsheetstore.SpreadsheetStore
All Implemented Interfaces:
AutoCloseable, org.spdx.storage.IModelStore, org.spdx.storage.ISerializableModelStore

public class SpreadsheetStore extends org.spdx.storage.simple.ExtendedSpdxStore implements org.spdx.storage.ISerializableModelStore
SPDX Java Library store which serializes and deserializes to Microsoft Excel Workbooks
Author:
Gary O'Neall
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Enum for the spreadsheet format type

    Nested classes/interfaces inherited from interface org.spdx.storage.IModelStore

    org.spdx.storage.IModelStore.IdType, org.spdx.storage.IModelStore.IModelStoreLock, org.spdx.storage.IModelStore.ModelUpdate
  • Constructor Summary

    Constructors
    Constructor
    Description
    SpreadsheetStore(org.spdx.storage.IModelStore baseStore)
    Construct an SPDX model store which serializes and deserializes to Microsoft Excel Workbooks
    SpreadsheetStore(org.spdx.storage.IModelStore baseStore, SpreadsheetStore.SpreadsheetFormatType spreadsheetFormat)
    Constructs an SPDX model store which serializes and deserializes to Microsoft Excel Workbooks in a specified format
  • Method Summary

    Modifier and Type
    Method
    Description
    org.spdx.library.model.v2.SpdxDocument
    deSerialize(InputStream stream, boolean overwrite)
    Deserialize an SPDX document from an input stream
    void
     
    void
    serialize(OutputStream stream, org.spdx.core.CoreModelObject modelObject)
    Serialize the SPDX model to an output stream
    void
    Unload the spreadsheet store

    Methods inherited from class org.spdx.storage.simple.ExtendedSpdxStore

    addValueToCollection, clear, clearValueCollection, close, collectionContains, collectionSize, create, delete, enterCriticalSection, exists, getAllItems, getCaseSensitiveId, getIdType, getNextId, getPropertyValueDescriptors, getTypedValue, getValue, isAnon, isCollectionMembersAssignableTo, isCollectionProperty, isPropertyValueAssignableTo, leaveCriticalSection, listValues, removeProperty, removeValueFromCollection, setValue

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.AutoCloseable

    close

    Methods inherited from interface org.spdx.storage.IModelStore

    addValueToCollection, clearValueCollection, collectionContains, collectionSize, create, delete, enterCriticalSection, exists, getAllItems, getCaseSensisitiveId, getCaseSensitiveId, getIdType, getNextId, getPropertyValueDescriptors, getTypedValue, getValue, isAnon, isCollectionMembersAssignableTo, isCollectionProperty, isPropertyValueAssignableTo, leaveCriticalSection, listValues, removeProperty, removeValueFromCollection, setValue
  • Constructor Details

    • SpreadsheetStore

      public SpreadsheetStore(org.spdx.storage.IModelStore baseStore, SpreadsheetStore.SpreadsheetFormatType spreadsheetFormat)
      Constructs an SPDX model store which serializes and deserializes to Microsoft Excel Workbooks in a specified format
      Parameters:
      baseStore - SPDX model store for deserialization/serialization
      spreadsheetFormat - format type XLS or XLSX
    • SpreadsheetStore

      public SpreadsheetStore(org.spdx.storage.IModelStore baseStore)
      Construct an SPDX model store which serializes and deserializes to Microsoft Excel Workbooks
      Parameters:
      baseStore - SPDX model store for deserialization/serialization
  • Method Details

    • serialize

      public void serialize(OutputStream stream) throws org.spdx.core.InvalidSPDXAnalysisException, IOException
      Specified by:
      serialize in interface org.spdx.storage.ISerializableModelStore
      Throws:
      org.spdx.core.InvalidSPDXAnalysisException
      IOException
    • serialize

      public void serialize(OutputStream stream, @Nullable org.spdx.core.CoreModelObject modelObject) throws org.spdx.core.InvalidSPDXAnalysisException, IOException
      Serialize the SPDX model to an output stream
      Specified by:
      serialize in interface org.spdx.storage.ISerializableModelStore
      Parameters:
      stream - Output stream to write the serialized data.
      modelObject - Optional SPDX document to serialize. If null, the default document is used.
      Throws:
      org.spdx.core.InvalidSPDXAnalysisException - If the model is invalid or unsupported.
      IOException - If an I/O error occurs.
    • deSerialize

      public org.spdx.library.model.v2.SpdxDocument deSerialize(InputStream stream, boolean overwrite) throws org.spdx.core.InvalidSPDXAnalysisException, IOException
      Deserialize an SPDX document from an input stream
      Specified by:
      deSerialize in interface org.spdx.storage.ISerializableModelStore
      Parameters:
      stream - Input stream containing the serialized SPDX document.
      overwrite - Whether to overwrite an existing document in the store.
      Returns:
      The deserialized SpdxDocument.
      Throws:
      org.spdx.core.InvalidSPDXAnalysisException - If the document is invalid or unsupported.
      IOException - If an I/O error occurs.
    • unload

      public void unload()
      Unload the spreadsheet store