Class LicenseJsonFormatWriter
java.lang.Object
org.spdx.licenselistpublisher.licensegenerator.LicenseJsonFormatWriter
- All Implemented Interfaces:
ILicenseFormatWriter
Writes JSON format license information
- Author:
- Gary O'Neall
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetJsonFolder(File jsonFolder) voidsetJsonFolderDetails(File jsonFolderDetails) voidsetJsonFolderExceptions(File jsonFolderExceptions) voidwriteException(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 applicable
-
Constructor Details
-
LicenseJsonFormatWriter
public LicenseJsonFormatWriter(String version, String releaseDate, File jsonFolder, File jsonFolderDetails, File jsonFolderExceptions) - Parameters:
version- License list versionreleaseDate- release date for the license listjsonFolder- Folder to output the main JSON filejsonFolderDetails- Folder to output a detailed JSON file per licensejsonFolderExceptions- Folder to output a detailed JSON file per exception
-
-
Method Details
-
getJsonFolder
- Returns:
- the jsonFolder
-
setJsonFolder
- Parameters:
jsonFolder- the jsonFolder to set
-
getJsonFolderExceptions
- Returns:
- the jsonFolderExceptions
-
setJsonFolderExceptions
- Parameters:
jsonFolderExceptions- the jsonFolderExceptions to set
-
getJsonFolderDetails
- Returns:
- the jsonFolderDetails
-
setJsonFolderDetails
- Parameters:
jsonFolderDetails- the jsonFolderDetails to set
-
writeLicense
public void writeLicense(ListedLicenseContainer licenseContainer, boolean deprecated, String deprecatedVersion) throws IOException, 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:
IOExceptionorg.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:
IOException
-
writeException
public void writeException(ListedExceptionContainer exceptionContainer) throws IOException, org.spdx.core.InvalidSPDXAnalysisException - Specified by:
writeExceptionin interfaceILicenseFormatWriter- Parameters:
exceptionContainer- Exception to be formatted and written- Throws:
IOExceptionorg.spdx.core.InvalidSPDXAnalysisException
-