org.thewonderlemming.c4plantuml.linter

## Class Linter

- java.lang.Object
- - org.thewonderlemming.c4plantuml.linter.Linter

-     public class Linter
      extends Object

  A linting engine that parses C4 files and passes the result `ParseTree` to a set of `AbstractLintingRule`.
  Author:
    thewonderlemming

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Linter(org.thewonderlemming.c4plantuml.commons.Reporter reporter, Set<AbstractLintingRule> activeRules)` Default constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static LinterBuilder` | `builder()` returns a new instance of `LinterBuilder` since the default constructor is protected.
    `Set<AbstractLintingRule>` | `getActiveRules()` Returns the set of active `AbstractLintingRule` to be used on parsed files.
    `void` | `lint(Path c4SourceFile)` Same as `lint(Path, Charset)` but with UTF-8 as default `Charset`.
    `void` | `lint(Path c4SourceFile, Charset charset)` Parses a C4 file and if no error occurs, passes the resulting `ParseTree` through every active `AbstractLintingRule`.

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

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

- - ### Constructor Detail

    - #### Linter

          protected Linter(org.thewonderlemming.c4plantuml.commons.Reporter reporter,
                           Set<AbstractLintingRule> activeRules)

      Default constructor.
      Parameters:
        `reporter` - the reporter to report linting errors to.
        `activeRules` - the set of `AbstractLintingRule` to use.

  - ### Method Detail

    - #### builder

          public static LinterBuilder builder()

      returns a new instance of `LinterBuilder` since the default constructor is protected.
      Returns:
        a new builder instance.

    - #### getActiveRules

          public Set<AbstractLintingRule> getActiveRules()

      Returns the set of active `AbstractLintingRule` to be used on parsed files.
      Returns:
        the set of active `AbstractLintingRule` to use.

    - #### lint

          public void lint(Path c4SourceFile)

      Same as `lint(Path, Charset)` but with UTF-8 as default `Charset`.
      Parameters:
        `c4SourceFile` - the C4 file to process.
      See Also:
        `lint(Path, Charset)`

    - #### lint

          public void lint(Path c4SourceFile,
                           Charset charset)

      Parses a C4 file and if no error occurs, passes the resulting `ParseTree` through every active `AbstractLintingRule`.

      Any syntax error in the file will be reported to a `LinterSyntaxErrorListener`.

      Linting errors will be reported to the instance `Reporter`.

      Parameters:
        `c4SourceFile` - the C4 source file to process.
        `charset` - the `Charset` of the file.

Copyright © 2020. All rights reserved.