org.thewonderlemming.c4plantuml.linter

## Class LinterSyntaxErrorListener

- java.lang.Object
- - org.antlr.v4.runtime.BaseErrorListener
  - - org.thewonderlemming.c4plantuml.linter.LinterSyntaxErrorListener

- All Implemented Interfaces:
    org.antlr.v4.runtime.ANTLRErrorListener

      public class LinterSyntaxErrorListener
      extends org.antlr.v4.runtime.BaseErrorListener

  An observer pattern to enable `AbstractLintingRule` to be notified on syntax errors.
  Author:
    thewonderlemming

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LinterSyntaxErrorListener()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `registerRule(AbstractLintingRule rule)` registers an `AbstractLintingRule` so that it can be notified of syntax errors.
    `void` | `syntaxError(org.antlr.v4.runtime.Recognizer<?,?> recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, org.antlr.v4.runtime.RecognitionException e)` Reports a parsing syntax error to the registered rules.
    `void` | `unregisterRule(AbstractLintingRule rule)` Unregister a `AbstractLintingRule` so that it won't be notified of syntax errors anymore.

    - ### Methods inherited from class org.antlr.v4.runtime.BaseErrorListener

      `reportAmbiguity, reportAttemptingFullContext, reportContextSensitivity`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LinterSyntaxErrorListener

          public LinterSyntaxErrorListener()

  - ### Method Detail

    - #### registerRule

          public void registerRule(AbstractLintingRule rule)

      registers an `AbstractLintingRule` so that it can be notified of syntax errors.
      Parameters:
        `rule` - the rule to register.

    - #### syntaxError

          public void syntaxError(org.antlr.v4.runtime.Recognizer<?,?> recognizer,
                                  Object offendingSymbol,
                                  int line,
                                  int charPositionInLine,
                                  String msg,
                                  org.antlr.v4.runtime.RecognitionException e)

      Reports a parsing syntax error to the registered rules.
      Specified by:
        `syntaxError` in interface `org.antlr.v4.runtime.ANTLRErrorListener`
      Overrides:
        `syntaxError` in class `org.antlr.v4.runtime.BaseErrorListener`

    - #### unregisterRule

          public void unregisterRule(AbstractLintingRule rule)

      Unregister a `AbstractLintingRule` so that it won't be notified of syntax errors anymore.
      Parameters:
        `rule` - the rule to unregister.

Copyright © 2020. All rights reserved.