Class LicenseJsonFormatWriter

java.lang.Object
org.spdx.licenselistpublisher.licensegenerator.LicenseJsonFormatWriter
All Implemented Interfaces:
ILicenseFormatWriter

public class LicenseJsonFormatWriter extends Object implements ILicenseFormatWriter
Writes JSON format license information
Author:
Gary O'Neall
  • Constructor Details

    • LicenseJsonFormatWriter

      public LicenseJsonFormatWriter(String version, String releaseDate, File jsonFolder, File jsonFolderDetails, File jsonFolderExceptions)
      Parameters:
      version - License list version
      releaseDate - release date for the license list
      jsonFolder - Folder to output the main JSON file
      jsonFolderDetails - Folder to output a detailed JSON file per license
      jsonFolderExceptions - Folder to output a detailed JSON file per exception
  • Method Details

    • getJsonFolder

      public File getJsonFolder()
      Returns:
      the jsonFolder
    • setJsonFolder

      public void setJsonFolder(File jsonFolder)
      Parameters:
      jsonFolder - the jsonFolder to set
    • getJsonFolderExceptions

      public File getJsonFolderExceptions()
      Returns:
      the jsonFolderExceptions
    • setJsonFolderExceptions

      public void setJsonFolderExceptions(File jsonFolderExceptions)
      Parameters:
      jsonFolderExceptions - the jsonFolderExceptions to set
    • getJsonFolderDetails

      public File getJsonFolderDetails()
      Returns:
      the jsonFolderDetails
    • setJsonFolderDetails

      public void setJsonFolderDetails(File jsonFolderDetails)
      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: ILicenseFormatWriter
      Formats and writes a specific license
      Specified by:
      writeLicense in interface ILicenseFormatWriter
      Parameters:
      licenseContainer - License to be added
      deprecated - True if deprecated
      deprecatedVersion - License list version when the license was deprecated, null otherwise
      Throws:
      IOException
      org.spdx.core.InvalidSPDXAnalysisException
      org.spdx.licenseTemplate.InvalidLicenseTemplateException
    • writeToC

      public void writeToC() throws IOException
      Description copied from interface: ILicenseFormatWriter
      Write the Table of Contents file for the format if applicable
      Specified by:
      writeToC in interface ILicenseFormatWriter
      Throws:
      IOException
    • writeException

      public void writeException(ListedExceptionContainer exceptionContainer) throws IOException, org.spdx.core.InvalidSPDXAnalysisException
      Specified by:
      writeException in interface ILicenseFormatWriter
      Parameters:
      exceptionContainer - Exception to be formatted and written
      Throws:
      IOException
      org.spdx.core.InvalidSPDXAnalysisException