Class JsonLDSerializer
java.lang.Object
org.spdx.v3jsonldstore.JsonLDSerializer
- Author:
- Gary O'Neall
Serializer to serialize a model store containing SPDX Spec version 3 elements
The
serialize()method will serialize the@graphfor all SPDX elements stored in the model store. Theserialize(SpdxElement element)will serialize a single element
-
Constructor Summary
ConstructorsConstructorDescriptionJsonLDSerializer(com.fasterxml.jackson.databind.ObjectMapper jsonMapper, boolean pretty, boolean useExternalListedElements, String specVersion, org.spdx.storage.IModelStore modelStore) -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JsonNodeserialize(org.spdx.core.CoreModelObject objectToSerialize)
-
Constructor Details
-
JsonLDSerializer
public JsonLDSerializer(com.fasterxml.jackson.databind.ObjectMapper jsonMapper, boolean pretty, boolean useExternalListedElements, String specVersion, org.spdx.storage.IModelStore modelStore) throws net.jimblackler.jsonschemafriend.GenerationException - Parameters:
jsonMapper- mapper to use for serializationpretty- true if the format is to be more verboseuseExternalListedElements- if true, don't serialize any listed licenses or exceptions - treat them as externalspecVersion- SemVer representation of the SPDX spec versionmodelStore- store where the SPDX elements are stored- Throws:
net.jimblackler.jsonschemafriend.GenerationException- if the JSON schema is not found or is not valid
-
-
Method Details
-
serialize
public com.fasterxml.jackson.databind.JsonNode serialize(@Nullable org.spdx.core.CoreModelObject objectToSerialize) throws org.spdx.core.InvalidSPDXAnalysisException - Parameters:
objectToSerialize- optional SPDX Document or single element to serialize- Returns:
- the root node of the JSON serialization
- Throws:
org.spdx.core.InvalidSPDXAnalysisException- on errors retrieving the information for serialization
-
getSchema
- Returns:
- JSON LD Schema
-