Class JacksonSerializer

java.lang.Object
org.spdx.jacksonstore.JacksonSerializer

public class JacksonSerializer extends Object
Serializer for a model store to convert the document model object into a JsonNode

the method docToJsonNode(String documentUri) will generate the JSON node for a document

Author:
Gary O'Neall
  • Constructor Details

    • JacksonSerializer

      public JacksonSerializer(com.fasterxml.jackson.databind.ObjectMapper mapper, MultiFormatStore.Format format, MultiFormatStore.Verbose verbose, org.spdx.storage.IModelStore store)
      Parameters:
      mapper - Jackson Object Mapper to use for creating JSON objects
      format - Format to use
      store - Model store containing the documents
  • Method Details

    • docsToJsonNode

      public com.fasterxml.jackson.databind.node.ArrayNode docsToJsonNode(List<String> documentUris) throws org.spdx.core.InvalidSPDXAnalysisException
      Parameters:
      documentUris - list of document uris
      Returns:
      JSON array of all documents which have the document Uris
      Throws:
      org.spdx.core.InvalidSPDXAnalysisException - on SPDX parsing errors
    • docToJsonNode

      public com.fasterxml.jackson.databind.node.ObjectNode docToJsonNode(String documentUri) throws org.spdx.core.InvalidSPDXAnalysisException
      Parameters:
      documentUri - URI for the document to be converted
      Returns:
      ObjectNode for an SPDX document in Jackson JSON tree format
      Throws:
      org.spdx.core.InvalidSPDXAnalysisException - on SPDX parsing errors