Class JsonLDStore
java.lang.Object
org.spdx.storage.simple.ExtendedSpdxStore
org.spdx.v3jsonldstore.JsonLDStore
- All Implemented Interfaces:
AutoCloseable,IModelStore,ISerializableModelStore
Serializable store which reads and writes the SPDX Spec version 3 JSON-LD format
See the SPDX specification for details on the JSON-LD serialization:
https://github.com/spdx/spdx-spec/blob/develop/docs/serializations.md
For more information on SPDX document mapping to JSON-LD, see:
https://github.com/spdx/spdx-3-model/blob/develop/serialization/jsonld.md
- Author:
- Gary O'Neall
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.spdx.storage.IModelStore
IModelStore.IdType, IModelStore.IModelStoreLock, IModelStore.ModelUpdate -
Constructor Summary
ConstructorsConstructorDescriptionJsonLDStore(IModelStore baseStore) Constructs a JsonLDStore with the specified base storeJsonLDStore(IModelStore baseStore, boolean pretty) Constructs a JsonLDStore with the specified base store and pretty format option -
Method Summary
Modifier and TypeMethodDescriptionorg.spdx.library.model.v3_0_1.core.SpdxDocumentdeSerialize(InputStream stream, boolean overwrite) booleanCheck the pretty format option for JSON LD outputvoidserialize(OutputStream stream) voidserialize(OutputStream stream, CoreModelObject objectToSerialize) voidsetPretty(boolean pretty) Sets the pretty format option for JSON LD outputvoidsetUseExternalListedElements(boolean useExternalListedElements) Sets whether to use external listed elementsMethods 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
-
JsonLDStore
Constructs a JsonLDStore with the specified base store and pretty format option- Parameters:
baseStore- underlying store to usepretty- if true, use less compact prettier JSON LD format on output
-
JsonLDStore
Constructs a JsonLDStore with the specified base store- Parameters:
baseStore- underlying store to use
-
-
Method Details
-
getPretty
public boolean getPretty()Check the pretty format option for JSON LD output- Returns:
- if true, use less compact prettier JSON LD format on output
-
setPretty
public void setPretty(boolean pretty) Sets the pretty format option for JSON LD output- Parameters:
pretty- if true, use less compact prettier JSON LD format on output
-
serialize
- Specified by:
serializein interfaceISerializableModelStore- Throws:
InvalidSPDXAnalysisExceptionIOException
-
serialize
public void serialize(OutputStream stream, @Nullable CoreModelObject objectToSerialize) throws InvalidSPDXAnalysisException, IOException - Specified by:
serializein interfaceISerializableModelStore- Throws:
InvalidSPDXAnalysisExceptionIOException
-
deSerialize
public org.spdx.library.model.v3_0_1.core.SpdxDocument deSerialize(InputStream stream, boolean overwrite) throws InvalidSPDXAnalysisException, IOException - Specified by:
deSerializein interfaceISerializableModelStore- Throws:
InvalidSPDXAnalysisExceptionIOException
-
setUseExternalListedElements
public void setUseExternalListedElements(boolean useExternalListedElements) Sets whether to use external listed elements- Parameters:
useExternalListedElements- if true, don't serialize any listed licenses or exceptions - treat them as external
-