public class CompareTemplateOutputHandler extends Object implements ILicenseTemplateOutputHandler
| Modifier and Type | Class and Description |
|---|---|
class |
CompareTemplateOutputHandler.DifferenceDescription |
| Constructor and Description |
|---|
CompareTemplateOutputHandler(String compareText) |
| Modifier and Type | Method and Description |
|---|---|
void |
beginOptional(LicenseTemplateRule rule)
Begin optional rule found
|
void |
completeParsing()
Signals all text has been added and parsing can be completed.
|
void |
endOptional(LicenseTemplateRule rule)
End optional rule found
|
CompareTemplateOutputHandler.DifferenceDescription |
getDifferences() |
boolean |
matches()
Performs the actual parsing if it has not been completed.
|
void |
text(String text)
Text for processing
|
int |
textEquivalent(String text,
int startToken)
Compares the text against the compareText
|
void |
variableRule(LicenseTemplateRule rule)
Variable rule found within the template
|
public CompareTemplateOutputHandler(String compareText) throws IOException
compareText - Text to compare the parsed SPDX license template toIOException - This is not to be expected since we are using StringReaderspublic void text(String text)
ILicenseTemplateOutputHandlertext in interface ILicenseTemplateOutputHandlerpublic void variableRule(LicenseTemplateRule rule)
ILicenseTemplateOutputHandlervariableRule in interface ILicenseTemplateOutputHandlerpublic void beginOptional(LicenseTemplateRule rule)
ILicenseTemplateOutputHandlerbeginOptional in interface ILicenseTemplateOutputHandlerpublic void endOptional(LicenseTemplateRule rule)
ILicenseTemplateOutputHandlerendOptional in interface ILicenseTemplateOutputHandlerpublic boolean matches()
throws LicenseParserException
LicenseParserExceptionpublic CompareTemplateOutputHandler.DifferenceDescription getDifferences()
public void completeParsing()
throws LicenseParserException
ILicenseTemplateOutputHandlercompleteParsing in interface ILicenseTemplateOutputHandlerLicenseParserExceptionpublic int textEquivalent(String text, int startToken)
text - text to comparestartToken - token of the compareText to being the comparisonCopyright © 2018 Linux Foundation. All Rights Reserved.