Package org.spdx.storage
Interface ISerializableModelStore
-
- All Superinterfaces:
AutoCloseable
,IModelStore
public interface ISerializableModelStore extends IModelStore
A model store that can be serialized and de-serialized to and from aStream
- Author:
- Gary O'Neall
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.spdx.storage.IModelStore
IModelStore.IdType, IModelStore.IModelStoreLock, IModelStore.ModelUpdate
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CoreModelObject
deSerialize(InputStream stream, boolean overwrite)
Deserialize / read an SPDX document from a streamvoid
serialize(OutputStream stream)
Serialize all the items stored in the model storevoid
serialize(OutputStream stream, CoreModelObject objectToSerialize)
Serialize the items stored in the model store-
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
-
-
-
-
Method Detail
-
serialize
void serialize(OutputStream stream) throws InvalidSPDXAnalysisException, IOException
Serialize all the items stored in the model storeThe specific format for serialization depends on the document store.
- Parameters:
stream
- output stream to serialize to- Throws:
InvalidSPDXAnalysisException
- on any SPDX errorIOException
- on IO error
-
serialize
void serialize(OutputStream stream, @Nullable CoreModelObject objectToSerialize) throws InvalidSPDXAnalysisException, IOException
Serialize the items stored in the model storeThe specific format for serialization depends on the document store.
- Parameters:
stream
- output stream to serialize toobjectToSerialize
- if an SpdxDocument, serialize all elements represented by that document, otherwise serialize just the object. If null, serialize all items in the store.- Throws:
InvalidSPDXAnalysisException
- on any SPDX errorIOException
- on IO error
-
deSerialize
CoreModelObject deSerialize(InputStream stream, boolean overwrite) throws InvalidSPDXAnalysisException, IOException
Deserialize / read an SPDX document from a stream- Parameters:
stream
- input stream to deserialize fromoverwrite
- if true, allow any existing documents with the same documentUri to be overwritten- Returns:
- a model object representing the deserialized SPDX data - commonly an SPDX Document, but depends on version and what was serialized
- Throws:
InvalidSPDXAnalysisException
- on any SPDX errorIOException
- on IO error
-
-