Package org.spdx.jacksonstore
Class MultiFormatStore
java.lang.Object
org.spdx.storage.simple.ExtendedSpdxStore
org.spdx.jacksonstore.MultiFormatStore
- All Implemented Interfaces:
AutoCloseable,org.spdx.storage.IModelStore,org.spdx.storage.ISerializableModelStore
public class MultiFormatStore
extends org.spdx.storage.simple.ExtendedSpdxStore
implements org.spdx.storage.ISerializableModelStore
Model store that supports multiple serialization formats (JSON, XML, YAML)
Note that the serialization/deserlization methods are synchronized to prevent the format or verbose changing while serilizing
- Author:
- Gary O'Neall
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMultiFormatStore.Formatstatic classMultiFormatStore.Verbose -
Constructor Summary
Constructors Constructor Description MultiFormatStore(org.spdx.storage.IModelStore baseStore, MultiFormatStore.Format format)Default compact version of MultiFormatStoreMultiFormatStore(org.spdx.storage.IModelStore baseStore, MultiFormatStore.Format format, MultiFormatStore.Verbose verbose) -
Method Summary
Modifier and Type Method Description static StringcollectionPropertyNameToPropertyName(String collectionPropertyName)StringdeSerialize(InputStream stream, boolean overwrite)MultiFormatStore.FormatgetFormat()MultiFormatStore.VerbosegetVerbose()static StringpropertyNameToCollectionPropertyName(String propertyName)voidserialize(String documentUri, OutputStream stream)voidsetFormat(MultiFormatStore.Format format)voidsetVerbose(MultiFormatStore.Verbose verbose)Methods inherited from class org.spdx.storage.simple.ExtendedSpdxStore
addValueToCollection, clear, clearValueCollection, close, collectionContains, collectionSize, create, delete, enterCriticalSection, exists, getAllItems, getCaseSensisitiveId, getDocumentUris, getIdType, getNextId, getPropertyValueNames, getTypedValue, getValue, 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 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
-
Constructor Details
-
MultiFormatStore
public MultiFormatStore(org.spdx.storage.IModelStore baseStore, MultiFormatStore.Format format, MultiFormatStore.Verbose verbose)- Parameters:
baseStore- modelStore to store the results of the desearializationformat- Format - XML, JSON or YAMLverbose- How verbose to make the document
-
MultiFormatStore
Default compact version of MultiFormatStore- Parameters:
baseStore- modelStore to store the results of the desearializationformat- Format - XML, JSON or YAML
-
-
Method Details
-
getFormat
- Returns:
- the format
-
setFormat
- Parameters:
format- the format to set
-
getVerbose
- Returns:
- the verbose
-
setVerbose
- Parameters:
verbose- the verbose to set
-
serialize
public void serialize(String documentUri, OutputStream stream) throws org.spdx.library.InvalidSPDXAnalysisException, IOException- Specified by:
serializein interfaceorg.spdx.storage.ISerializableModelStore- Throws:
org.spdx.library.InvalidSPDXAnalysisExceptionIOException
-
propertyNameToCollectionPropertyName
- Parameters:
propertyName-- Returns:
- property name used for an array or collection of these values
-
collectionPropertyNameToPropertyName
-
deSerialize
public String deSerialize(InputStream stream, boolean overwrite) throws org.spdx.library.InvalidSPDXAnalysisException, IOException- Specified by:
deSerializein interfaceorg.spdx.storage.ISerializableModelStore- Throws:
org.spdx.library.InvalidSPDXAnalysisExceptionIOException
-