Class LicenseMarkdownFormatWriter

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

public class LicenseMarkdownFormatWriter
extends Object
implements ILicenseFormatWriter
Formats MarkDown files for the licenses
Author:
Gary O'Neall
  • Constructor Details

    • LicenseMarkdownFormatWriter

      public LicenseMarkdownFormatWriter​(String version, String releaseDate, File markdownFile)
      Parameters:
      version - License list version
      releaseDate - release date for the license list
      markdownFile - Markdown formated file written by this class
  • Method Details

    • getMarkdownFile

      public File getMarkdownFile()
      Returns:
      the markdownFile
    • setMarkdownFile

      public void setMarkdownFile​(File markdownFile)
      Parameters:
      markdownFile - the markdownFile to set
    • writeLicense

      public void writeLicense​(org.spdx.library.model.license.SpdxListedLicense license, boolean deprecated, String deprecatedVersion) throws IOException, org.spdx.library.InvalidSPDXAnalysisException
      Description copied from interface: ILicenseFormatWriter
      Formats and writes a specific license
      Specified by:
      writeLicense in interface ILicenseFormatWriter
      Parameters:
      license - License to be added
      deprecated - True if deprecated
      deprecatedVersion - License list version when the license was deprecated, null otherwise
      Throws:
      IOException
      org.spdx.library.InvalidSPDXAnalysisException
    • 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​(org.spdx.library.model.license.ListedLicenseException exception) throws IOException, org.spdx.library.InvalidSPDXAnalysisException
      Specified by:
      writeException in interface ILicenseFormatWriter
      Parameters:
      exception - Exception to be formatted and written
      Throws:
      IOException
      org.spdx.library.InvalidSPDXAnalysisException