Package org.spdx.licenseTemplate
Class HtmlTemplateOutputHandler
java.lang.Object
org.spdx.licenseTemplate.HtmlTemplateOutputHandler
- All Implemented Interfaces:
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidBegin optional rule foundvoidSignals all text has been added and parsing can be completed.voidEnd 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 StringFormat HTML for an optional stringgetHtml()voidText for processingvoidVariable rule found within the template
-
Field Details
-
REPLACEABLE_LICENSE_TEXT_CLASS
- See Also:
-
OPTIONAL_LICENSE_TEXT_CLASS
- See Also:
-
-
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
-