Package org.spdx.licenseTemplate
Class HtmlTemplateOutputHandler
java.lang.Object
org.spdx.licenseTemplate.HtmlTemplateOutputHandler
- All Implemented Interfaces:
ILicenseTemplateOutputHandler
public class HtmlTemplateOutputHandler extends Object implements ILicenseTemplateOutputHandler
License template output handler for generating an HTML version of a license from a license template.
Used when parsing a license template.
- Author:
- Gary O'Neall
-
Field Summary
Fields Modifier and Type Field Description static StringOPTIONAL_LICENSE_TEXT_CLASSstatic StringREPLACEABLE_LICENSE_TEXT_CLASS -
Constructor Summary
Constructors Constructor Description HtmlTemplateOutputHandler() -
Method Summary
Modifier and Type Method Description voidbeginOptional(LicenseTemplateRule rule)Begin optional rule foundvoidcompleteParsing()Signals all text has been added and parsing can be completed.voidendOptional(LicenseTemplateRule rule)End optional rule foundstatic StringescapeIdString(String id)Escape the ID string to conform to the legal characters for an HTML ID stringstatic StringformatEndOptionalHTML(boolean inParagraph)static StringformatReplaceabledHTML(String text, String id)Format HTML for a replaceable stringstatic StringformatStartOptionalHTML(String id)Format HTML for an optional stringStringgetHtml()voidtext(String text)Text for processingvoidvariableRule(LicenseTemplateRule rule)Variable rule found within the template
-
Field Details
-
Constructor Details
-
HtmlTemplateOutputHandler
public HtmlTemplateOutputHandler()
-
-
Method Details
-
text
Description copied from interface:ILicenseTemplateOutputHandlerText for processing- Specified by:
textin interfaceILicenseTemplateOutputHandler
-
variableRule
Description copied from interface:ILicenseTemplateOutputHandlerVariable rule found within the template- Specified by:
variableRulein interfaceILicenseTemplateOutputHandler
-
formatReplaceabledHTML
Format HTML for a replaceable string- Parameters:
text- text for the optional license stringid- ID used for the div- Returns:
-
escapeIdString
Escape the ID string to conform to the legal characters for an HTML ID string- Parameters:
id-- Returns:
-
getHtml
- Returns:
-
beginOptional
Description copied from interface:ILicenseTemplateOutputHandlerBegin optional rule found- Specified by:
beginOptionalin interfaceILicenseTemplateOutputHandler
-
formatStartOptionalHTML
Format HTML for an optional string- Parameters:
id- ID used for the div- Returns:
-
formatEndOptionalHTML
-
endOptional
Description copied from interface:ILicenseTemplateOutputHandlerEnd optional rule found- Specified by:
endOptionalin interfaceILicenseTemplateOutputHandler
-
completeParsing
public void completeParsing()Description copied from interface:ILicenseTemplateOutputHandlerSignals all text has been added and parsing can be completed.- Specified by:
completeParsingin interfaceILicenseTemplateOutputHandler
-