Package org.spdx.spreadsheetstore
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 ClassesModifier and TypeClassDescriptionstatic enumEnum for the spreadsheet format typeNested 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
ConstructorsConstructorDescriptionSpreadsheetStore(org.spdx.storage.IModelStore baseStore) Construct an SPDX model store which serializes and deserializes to Microsoft Excel WorkbooksSpreadsheetStore(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 TypeMethodDescriptionorg.spdx.library.model.v2.SpdxDocumentdeSerialize(InputStream stream, boolean overwrite) Deserialize an SPDX document from an input streamvoidserialize(OutputStream stream) voidserialize(OutputStream stream, org.spdx.core.CoreModelObject modelObject) Serialize the SPDX model to an output streamvoidunload()Unload the spreadsheet storeMethods 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, setValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.AutoCloseable
closeMethods 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/serializationspreadsheetFormat- 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:
serializein interfaceorg.spdx.storage.ISerializableModelStore- Throws:
org.spdx.core.InvalidSPDXAnalysisExceptionIOException
-
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:
serializein interfaceorg.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:
deSerializein interfaceorg.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
-