public class SpdxLicenseTemplateHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static Pattern |
RULE_PATTERN |
| Constructor and Description |
|---|
SpdxLicenseTemplateHelper() |
| Modifier and Type | Method and Description |
|---|---|
static String |
addHtmlFormatting(String text)
Adds HTML formatting
and |
static String |
addHtmlFormatting(String text,
boolean inParagraph)
Adds HTML formatting
and |
static String |
formatEscapeHTML(String text)
Escapes and formats text
|
static String |
formatEscapeHTML(String text,
boolean inParagraph)
Escapes and formats text
|
static String |
htmlToText(String html)
Converts an HTML string to text preserving line breaks for
tags |
static void |
parseTemplate(String licenseTemplate,
ILicenseTemplateOutputHandler templateOutputHandler)
Parses the license template calling the templateOutputHandler for any text and rules found
|
static String |
templateTextToHtml(String licenseTemplate)
Converts a license template string to formatted HTML which highlights any
rules or tags
|
static String |
templateToText(String template)
Converts template text to standard default text using any default parameters in the rules
|
public static final Pattern RULE_PATTERN
public static void parseTemplate(String licenseTemplate, ILicenseTemplateOutputHandler templateOutputHandler) throws LicenseTemplateRuleException, LicenseParserException
licenseTemplate - License template to be parsedtemplateOutputHandler - Handles the text, optional text, and variable rules text foundLicenseParserExceptionLicenseTemplateRuleExceptionpublic static String templateTextToHtml(String licenseTemplate) throws LicenseTemplateRuleException
licenseTemplate - LicenseTemplateRuleExceptionLicenseParserExceptionpublic static String templateToText(String template) throws LicenseTemplateRuleException
template - LicenseTemplateRuleExceptionLicenseParserExceptionpublic static String formatEscapeHTML(String text)
text - unformatted textpublic static String formatEscapeHTML(String text, boolean inParagraph)
text - unformatted textinParagraph - true if inside a paragraph tagpublic static String addHtmlFormatting(String text)
text - unformatted textpublic static String addHtmlFormatting(String text, boolean inParagraph)
text - unformatted textinParagraph - true if inside a paragraph tagCopyright © 2018 Linux Foundation. All Rights Reserved.