Class AbstractNameCheck

All Implemented Interfaces:
Configurable, Contextualizable
Direct Known Subclasses:
AbstractAccessControlNameCheck, CatchParameterNameCheck, ClassTypeParameterNameCheck, IllegalIdentifierNameCheck, InterfaceTypeParameterNameCheck, LambdaParameterNameCheck, LocalFinalVariableNameCheck, LocalVariableNameCheck, MethodTypeParameterNameCheck, ParameterNameCheck, PatternVariableNameCheck, RecordComponentNameCheck, RecordTypeParameterNameCheck

public abstract class AbstractNameCheck extends AbstractCheck
Abstract class for checking that names conform to a specified format.
  • Field Details

  • Constructor Details

    • AbstractNameCheck

      protected AbstractNameCheck(String format)
      Creates a new AbstractNameCheck instance.
      Parameters:
      format - format to check with
  • Method Details

    • mustCheckName

      protected abstract boolean mustCheckName(DetailAST ast)
      Decides whether the name of an AST should be checked against the format regexp.
      Parameters:
      ast - the AST to check.
      Returns:
      true if the IDENT subnode of ast should be checked against the format regexp.
    • setFormat

      public final void setFormat(Pattern pattern)
      Sets the pattern to match valid identifiers.
      Parameters:
      pattern - the new pattern
    • visitToken

      public void visitToken(DetailAST ast)
      Description copied from class: AbstractCheck
      Called to process a token.
      Overrides:
      visitToken in class AbstractCheck
      Parameters:
      ast - the token to process