Class LicenseV3JsonLdFormatWriter
java.lang.Object
org.spdx.licenselistpublisher.licensegenerator.LicenseV3JsonLdFormatWriter
- All Implemented Interfaces:
ILicenseFormatWriter
Writes SPDX JsonLD files compliant with the SPDX Spec version 3
- Author:
- Gary O'Neall
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLicenseV3JsonLdFormatWriter(String version, String releaseDate, File jsonLdFolder) -
Method Summary
Modifier and TypeMethodDescriptionvoidwriteException(ListedExceptionContainer exceptionContainer) voidwriteLicense(ListedLicenseContainer licenseContainer, boolean deprecated, String deprecatedVersion) Formats and writes a specific licensevoidwriteToC()Write the Table of Contents file for the format if applicablestatic voidwriteV3JsonLD(org.spdx.v3jsonldstore.JsonLDStore store, Path filePath, boolean pretty)
-
Field Details
-
SPDX_V3_FOLDER_NAME
- See Also:
-
SPDX_V3_JSON_LD_FOLDER_NAME
- See Also:
-
-
Constructor Details
-
LicenseV3JsonLdFormatWriter
public LicenseV3JsonLdFormatWriter(String version, String releaseDate, File jsonLdFolder) throws org.spdx.core.InvalidSPDXAnalysisException - Parameters:
version- License list versionreleaseDate- release date for the license listjsonLdFolder- Folder to output the license TOC file, the exception TOC file, all license and exception details- Throws:
org.spdx.core.InvalidSPDXAnalysisException- on error creating TOC stores and/or objects
-
-
Method Details
-
writeV3JsonLD
public static void writeV3JsonLD(org.spdx.v3jsonldstore.JsonLDStore store, Path filePath, boolean pretty) throws LicenseGeneratorException - Parameters:
store- JSONLD store containing the data to writefilePath- file path for the resultant filepretty- if true, the JSON LD file will be formatted to be (more) human readable- Throws:
LicenseGeneratorException- on any IO or SPDX parsing errors
-
writeLicense
public void writeLicense(ListedLicenseContainer licenseContainer, boolean deprecated, String deprecatedVersion) throws IOException, LicenseGeneratorException, org.spdx.core.InvalidSPDXAnalysisException, org.spdx.licenseTemplate.InvalidLicenseTemplateException Description copied from interface:ILicenseFormatWriterFormats and writes a specific license- Specified by:
writeLicensein interfaceILicenseFormatWriter- Parameters:
licenseContainer- License to be addeddeprecated- True if deprecateddeprecatedVersion- License list version when the license was deprecated, null otherwise- Throws:
IOExceptionLicenseGeneratorExceptionorg.spdx.core.InvalidSPDXAnalysisExceptionorg.spdx.licenseTemplate.InvalidLicenseTemplateException
-
writeToC
Description copied from interface:ILicenseFormatWriterWrite the Table of Contents file for the format if applicable- Specified by:
writeToCin interfaceILicenseFormatWriter- Throws:
IOExceptionLicenseGeneratorException
-
writeException
public void writeException(ListedExceptionContainer exceptionContainer) throws IOException, LicenseGeneratorException, org.spdx.licenseTemplate.InvalidLicenseTemplateException, org.spdx.core.InvalidSPDXAnalysisException - Specified by:
writeExceptionin interfaceILicenseFormatWriter- Parameters:
exceptionContainer- Exception to be formatted and written- Throws:
IOExceptionLicenseGeneratorExceptionorg.spdx.licenseTemplate.InvalidLicenseTemplateExceptionorg.spdx.core.InvalidSPDXAnalysisException
-