Package org.spdx.v3jsonldstore
Class JsonLDStore
- java.lang.Object
-
- org.spdx.storage.simple.ExtendedSpdxStore
-
- org.spdx.v3jsonldstore.JsonLDStore
-
- All Implemented Interfaces:
AutoCloseable
,org.spdx.storage.IModelStore
,org.spdx.storage.ISerializableModelStore
public class JsonLDStore extends org.spdx.storage.simple.ExtendedSpdxStore implements org.spdx.storage.ISerializableModelStore
Serializable store which reads and writes the SPDX Spec version 3 JSON LD format- Author:
- Gary O'Neall
-
-
Constructor Summary
Constructors Constructor Description JsonLDStore(org.spdx.storage.IModelStore baseStore)
Constructs a JsonLDStore with the specified base storeJsonLDStore(org.spdx.storage.IModelStore baseStore, boolean pretty)
Constructs a JsonLDStore with the specified base store and pretty format option
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.spdx.library.model.v3_0_1.core.SpdxDocument
deSerialize(InputStream stream, boolean overwrite)
boolean
getPretty()
Check the pretty format option for JSON LD outputvoid
serialize(OutputStream stream)
void
serialize(OutputStream stream, org.spdx.core.CoreModelObject objectToSerialize)
void
setPretty(boolean pretty)
Sets the pretty format option for JSON LD outputvoid
setUseExternalListedElements(boolean useExternalListedElements)
Sets whether to use external listed elements-
Methods 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, setValue
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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
-
-
-
-
Constructor Detail
-
JsonLDStore
public JsonLDStore(org.spdx.storage.IModelStore baseStore, boolean pretty)
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
public JsonLDStore(org.spdx.storage.IModelStore baseStore)
Constructs a JsonLDStore with the specified base store- Parameters:
baseStore
- underlying store to use
-
-
Method Detail
-
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
public void serialize(OutputStream stream) throws org.spdx.core.InvalidSPDXAnalysisException, IOException
- Specified by:
serialize
in interfaceorg.spdx.storage.ISerializableModelStore
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
IOException
-
serialize
public void serialize(OutputStream stream, @Nullable org.spdx.core.CoreModelObject objectToSerialize) throws org.spdx.core.InvalidSPDXAnalysisException, IOException
- Specified by:
serialize
in interfaceorg.spdx.storage.ISerializableModelStore
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
IOException
-
deSerialize
public org.spdx.library.model.v3_0_1.core.SpdxDocument deSerialize(InputStream stream, boolean overwrite) throws org.spdx.core.InvalidSPDXAnalysisException, IOException
- Specified by:
deSerialize
in interfaceorg.spdx.storage.ISerializableModelStore
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
IOException
-
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
-
-