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
Author:
Gary O'Neall Serializable store which reads and writes the SPDX Spec version 3 JSON LD format
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.spdx.storage.IModelStore

    org.spdx.storage.IModelStore.IdType, org.spdx.storage.IModelStore.IModelStoreLock, org.spdx.storage.IModelStore.ModelUpdate
  • Constructor Summary

    Constructors
    Constructor
    Description
    JsonLDStore(org.spdx.storage.IModelStore baseStore)
     
    JsonLDStore(org.spdx.storage.IModelStore baseStore, boolean pretty)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.spdx.library.model.v3_0_1.core.SpdxDocument
    deSerialize(InputStream stream, boolean overwrite)
     
    boolean
     
    void
     
    void
    serialize(OutputStream stream, org.spdx.core.CoreModelObject objectToSerialize)
     
    void
    setPretty(boolean pretty)
     
    void
    setUseExternalListedElements(boolean useExternalListedElements)
     

    Methods inherited from class org.spdx.storage.simple.ExtendedSpdxStore

    addValueToCollection, clear, clearValueCollection, close, collectionContains, collectionSize, create, delete, enterCriticalSection, exists, getAllItems, getCaseSensisitiveId, 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, getIdType, getNextId, getPropertyValueDescriptors, getTypedValue, getValue, isAnon, isCollectionMembersAssignableTo, isCollectionProperty, isPropertyValueAssignableTo, leaveCriticalSection, listValues, removeProperty, removeValueFromCollection, setValue
  • Constructor Details

    • JsonLDStore

      public JsonLDStore(org.spdx.storage.IModelStore baseStore, boolean pretty)
      Parameters:
      baseStore - underlying store to use
      pretty - if true, use less compact prettier JSON LD format on output
    • JsonLDStore

      public JsonLDStore(org.spdx.storage.IModelStore baseStore)
      Parameters:
      baseStore - underlying store to use
  • Method Details

    • getPretty

      public boolean getPretty()
      Returns:
      if true, use less compact prettier JSON LD format on output
    • setPretty

      public void setPretty(boolean pretty)
      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 interface org.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 interface org.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 interface org.spdx.storage.ISerializableModelStore
      Throws:
      org.spdx.core.InvalidSPDXAnalysisException
      IOException
    • setUseExternalListedElements

      public void setUseExternalListedElements(boolean useExternalListedElements)
      Parameters:
      useExternalListedElements - if true, don't serialize any listed licenses or exceptions - treat them as external