org.thewonderlemming.c4plantuml.linter.rules.builtin

## Class AliasesShouldFollowStandardConventionRule

- java.lang.Object
- - org.thewonderlemming.c4plantuml.linter.rules.AbstractLintingRule
  - - org.thewonderlemming.c4plantuml.linter.rules.builtin.AbstractC4Rule
    - - org.thewonderlemming.c4plantuml.linter.rules.builtin.AliasesShouldFollowStandardConventionRule

-     public class AliasesShouldFollowStandardConventionRule
      extends AbstractC4Rule

  A linting rule that checks that the aliases comply to a given regular expression.
  Author:
    thewonderlemming

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ALIAS_DEFAULT_FORMAT` The default regular expression to use for the aliases if no format is passed as a parameter of the rule.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AliasesShouldFollowStandardConventionRule(RuleParameters parameters)` Default constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.
    `static String` | `getAliasFormatParameterName()` Returns the name of the parameter that needs to be set to override the default value of the aliases regular expression `ALIAS_DEFAULT_FORMAT`.

    - ### Methods inherited from class org.thewonderlemming.c4plantuml.linter.rules.builtin.AbstractC4Rule

      `acceptableParsersTypes, selectParseTree, wrapUp`

    - ### Methods inherited from class org.thewonderlemming.c4plantuml.linter.rules.AbstractLintingRule

      `clearSyntaxErrors, getLogger, getParameters, getSyntaxErrors, reportSyntaxError`

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

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

- - ### Field Detail

    - #### ALIAS_DEFAULT_FORMAT

          public static final String ALIAS_DEFAULT_FORMAT

      The default regular expression to use for the aliases if no format is passed as a parameter of the rule.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### AliasesShouldFollowStandardConventionRule

          public AliasesShouldFollowStandardConventionRule(RuleParameters parameters)

      Default constructor.
      Parameters:
        `parameters` - the `RuleParameters` that are passed to control the behavior of this rule.

  - ### Method Detail

    - #### getAliasFormatParameterName

          public static String getAliasFormatParameterName()

      Returns the name of the parameter that needs to be set to override the default value of the aliases regular expression `ALIAS_DEFAULT_FORMAT`.
      Returns:
        the name of the parameter that controls the aliases regular expression value.

    - #### createParseTreeListener

          public 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.

      The `Reporter` can be passed at the `ParseTreeListener` if needed.

      Creates a `AliasesShouldFollowStandardConventionListener` instance as a listener.

      Specified by:
        `createParseTreeListener` in class `AbstractLintingRule`
      Parameters:
        `reporter` - the `Reporter` to pass to the new `ParseTreeListener`.
        `parserType` - the `Parser` for the current C4 grammar.
      Returns:
        the `ParseTreeListener` that matches the `Parser` grammar.

Copyright © 2020. All rights reserved.