Class JsonLDDeserializer


  • public class JsonLDDeserializer
    extends Object
    Class to manage deserializing SPDX 3.X JSON-LD
    Author:
    Gary O'Neall
    • Constructor Detail

      • JsonLDDeserializer

        public JsonLDDeserializer​(org.spdx.storage.IModelStore modelStore)
        Parameters:
        modelStore - Model store to deserialize the JSON text into
    • Method Detail

      • deserializeGraph

        public List<org.spdx.core.TypedValue> deserializeGraph​(com.fasterxml.jackson.databind.JsonNode graph)
                                                        throws org.spdx.core.InvalidSPDXAnalysisException
        Deserializes the JSON-LD graph into the modelStore
        Parameters:
        graph - Graph to deserialize
        Returns:
        list of non-anonymous typed value Elements found in the graph nodes
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException - on SPDX parsing errors
      • deserializeElement

        public org.spdx.core.TypedValue deserializeElement​(com.fasterxml.jackson.databind.JsonNode elementNode)
                                                    throws net.jimblackler.jsonschemafriend.GenerationException,
                                                           org.spdx.core.InvalidSPDXAnalysisException
        Deserialize a single element into the modelStore
        Parameters:
        elementNode - element to deserialize
        Returns:
        the typedValue of the deserialized object
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException - on invalid SPDX data
        net.jimblackler.jsonschemafriend.GenerationException - on errors with the JSON schemas