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 Summary
Constructors Constructor Description LicenseHtmlFormatWriter(String version, String releaseDate, File htmlFolder) -
Method Summary
Modifier and Type Method Description static StringformLicenseHTMLFileName(String id)FilegetHtmlFolder()voidsetHtmlFolder(File htmlFolder)voidwriteException(org.spdx.library.model.license.ListedLicenseException exception)voidwriteLicense(org.spdx.library.model.license.SpdxListedLicense license, boolean deprecated, String deprecatedVersion)Formats and writes a specific licensevoidwriteToC()Write the Table of Contents file for the format if applicable
-
Constructor Details
-
LicenseHtmlFormatWriter
- Parameters:
version- License list versionreleaseDate- release date for the license listhtmlFolder- Folder to output the HTML files
-
-
Method Details
-
getHtmlFolder
- Returns:
- the htmlFolder
-
setHtmlFolder
- Parameters:
htmlFolder- the htmlFolder to set
-
writeLicense
public void writeLicense(org.spdx.library.model.license.SpdxListedLicense license, boolean deprecated, String deprecatedVersion) throws IOException, org.spdx.library.InvalidSPDXAnalysisExceptionDescription copied from interface:ILicenseFormatWriterFormats and writes a specific license- Specified by:
writeLicensein interfaceILicenseFormatWriter- Parameters:
license- License to be addeddeprecated- True if deprecateddeprecatedVersion- License list version when the license was deprecated, null otherwise- Throws:
IOExceptionorg.spdx.library.InvalidSPDXAnalysisException
-
formLicenseHTMLFileName
- Parameters:
id-- Returns:
- HTML file name based on the license or exception ID replacing any invalid characters
-
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(org.spdx.library.model.license.ListedLicenseException exception) throws IOException, org.spdx.library.InvalidSPDXAnalysisException- Specified by:
writeExceptionin interfaceILicenseFormatWriter- Parameters:
exception- Exception to be formatted and written- Throws:
IOExceptionorg.spdx.library.InvalidSPDXAnalysisException
-