public abstract class AbstractLintingRule extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractLintingRule(RuleParameters parameters)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
abstract Set<Class<? extends org.antlr.v4.runtime.Parser>> |
acceptableParsersTypes()
Returns a list of supported ANTLR4
Parser. |
protected void |
clearSyntaxErrors()
Clears the reported
SyntaxError within the rule. |
abstract Optional<? extends org.antlr.v4.runtime.tree.ParseTreeListener> |
createParseTreeListener(org.thewonderlemming.c4plantuml.commons.Reporter reporter,
Class<? extends org.antlr.v4.runtime.Parser> parserType)
Returns a
ParseTreeListener given a Parser type. |
org.slf4j.Logger |
getLogger()
Returns the logger to be used within custom
AbstractLintingRule. |
protected RuleParameters |
getParameters()
Returns the current
AbstractLintingRule parameters. |
List<SyntaxError> |
getSyntaxErrors()
Returns a list of reported
SyntaxError. |
void |
reportSyntaxError(SyntaxError parseError)
Collects a new
SyntaxError. |
abstract Optional<org.antlr.v4.runtime.tree.ParseTree> |
selectParseTree(org.antlr.v4.runtime.Parser parser)
Selects a
ParseTree to process, given a Parser grammar. |
abstract void |
wrapUp()
A call that takes place after the parsing process of a file.
|
protected AbstractLintingRule(RuleParameters parameters)
parameters - the RuleParameters to pass to control the behavior of the rule.public abstract Set<Class<? extends org.antlr.v4.runtime.Parser>> acceptableParsersTypes()
Parser.Parser.public abstract Optional<? extends org.antlr.v4.runtime.tree.ParseTreeListener> createParseTreeListener(org.thewonderlemming.c4plantuml.commons.Reporter reporter, Class<? extends org.antlr.v4.runtime.Parser> parserType)
ParseTreeListener given a Parser type.
The Reporter can be passed at the ParseTreeListener if needed.
reporter - the Reporter to pass to the new ParseTreeListener.parserType - the Parser for the current C4 grammar.ParseTreeListener that matches the Parser grammar.public final org.slf4j.Logger getLogger()
AbstractLintingRule.public List<SyntaxError> getSyntaxErrors()
SyntaxError.SyntaxError.public final void reportSyntaxError(SyntaxError parseError)
SyntaxError.parseError - the SyntaxError to report.public abstract Optional<org.antlr.v4.runtime.tree.ParseTree> selectParseTree(org.antlr.v4.runtime.Parser parser)
ParseTree to process, given a Parser grammar.parser - the Parser instance to parse the current grammar.ParseTree that matches the current grammar.public abstract void wrapUp()
Implements that call if you need post processing at the end of the linting operation.
protected final void clearSyntaxErrors()
SyntaxError within the rule.protected final RuleParameters getParameters()
AbstractLintingRule parameters.RuleParameters.Copyright © 2020. All rights reserved.