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 a
Stream- 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
Modifier and Type Method Description StringdeSerialize(InputStream stream, boolean overwrite)Deserialize / read an SPDX document from a streamvoidserialize(String documentUri, OutputStream stream)Serialize the items stored in the documentUri.Methods inherited from interface org.spdx.storage.IModelStore
addValueToCollection, clearValueCollection, collectionContains, collectionSize, create, delete, enterCriticalSection, exists, getAllItems, getCaseSensisitiveId, getDocumentUris, getIdType, getNextId, getPropertyValueNames, getTypedValue, getValue, isCollectionMembersAssignableTo, isCollectionProperty, isPropertyValueAssignableTo, leaveCriticalSection, listValues, removeProperty, removeValueFromCollection, setValue
-
Method Details
-
serialize
void serialize(String documentUri, OutputStream stream) throws InvalidSPDXAnalysisException, IOExceptionSerialize the items stored in the documentUri. The specific format for serialization depends on the document store.- Parameters:
documentUri- URI for the document to be serializedstream- output stream to serialize to- Throws:
InvalidSPDXAnalysisExceptionIOException
-
deSerialize
String deSerialize(InputStream stream, boolean overwrite) throws InvalidSPDXAnalysisException, IOExceptionDeserialize / 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:
- document URI of the document
- Throws:
InvalidSPDXAnalysisExceptionIOException
-