Class LicenseHtmlFormatWriter

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

public class LicenseHtmlFormatWriter extends Object implements ILicenseFormatWriter
Generates HTML fragments with formatted license information
Author:
Gary O'Neall
  • Constructor Details

    • LicenseHtmlFormatWriter

      public LicenseHtmlFormatWriter(String version, String releaseDate, File htmlFolder)
      Parameters:
      version - License list version
      releaseDate - release date for the license list
      htmlFolder - Folder to output the HTML files
  • Method Details

    • getHtmlFolder

      public File getHtmlFolder()
      Returns:
      the htmlFolder
    • setHtmlFolder

      public void setHtmlFolder(File htmlFolder)
      Parameters:
      htmlFolder - the htmlFolder to set
    • writeLicense

      public void writeLicense(ListedLicenseContainer licenseContainer, boolean deprecated, String deprecatedVersion) throws IOException, org.spdx.core.InvalidSPDXAnalysisException
      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
    • formLicenseHTMLFileName

      public static String formLicenseHTMLFileName(String id)
      Parameters:
      id -
      Returns:
      HTML file name based on the license or exception ID replacing any invalid characters
    • 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