Class RightCurlyCheck.Details

java.lang.Object
com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck.Details
Enclosing class:
RightCurlyCheck

private static final class RightCurlyCheck.Details extends Object
Structure that contains all details for validation.
  • Field Details

  • Constructor Details

    • Details

      private Details(DetailAST lcurly, DetailAST rcurly, DetailAST nextToken, boolean shouldCheckLastRcurly)
      Constructor.
      Parameters:
      lcurly - the lcurly of the token whose details are being collected
      rcurly - the rcurly of the token whose details are being collected
      nextToken - the token after the token whose details are being collected
      shouldCheckLastRcurly - boolean value to determine if to check last rcurly
  • Method Details

    • getDetails

      Collects validation Details.
      Parameters:
      ast - a DetailAST value
      Returns:
      object containing all details to make a validation
    • getDetailsForSwitch

      Collects details about switch statements and expressions.
      Parameters:
      switchNode - switch statement or expression to gather details about
      Returns:
      new Details about given switch statement or expression
    • getDetailsForCase

      Collects details about case statements.
      Parameters:
      caseNode - case statement to gather details about
      Returns:
      new Details about given case statement
    • isSwitchExpression

      private static boolean isSwitchExpression(DetailAST switchNode)
      Check whether switch is expression or not.
      Parameters:
      switchNode - switch statement or expression to provide detail
      Returns:
      true if it is a switch expression
    • getDetailsForTryCatch

      Collects validation details for LITERAL_TRY, and LITERAL_CATCH.
      Parameters:
      ast - a DetailAST value
      Returns:
      object containing all details to make a validation
    • getDetailsForIf

      Collects validation details for LITERAL_IF.
      Parameters:
      ast - a DetailAST value
      Returns:
      object containing all details to make a validation
    • getDetailsForOthers

      Collects validation details for CLASS_DEF, RECORD_DEF, METHOD DEF, CTOR_DEF, STATIC_INIT, INSTANCE_INIT, ANNOTATION_DEF, ENUM_DEF, and COMPACT_CTOR_DEF.
      Parameters:
      ast - a DetailAST value
      Returns:
      an object containing all details to make a validation
    • isTokenWithNoChildSlist

      private static boolean isTokenWithNoChildSlist(int tokenType)
      Tests whether the provided tokenType will never have a SLIST as child in its AST. Like CLASS_DEF, ANNOTATION_DEF etc.
      Parameters:
      tokenType - the tokenType to test against.
      Returns:
      weather provided tokenType is definition token.
    • getDetailsForDoLoops

      Collects validation details for LITERAL_DO loops' tokens.
      Parameters:
      ast - a DetailAST value
      Returns:
      an object containing all details to make a validation
    • getNextToken

      private static DetailAST getNextToken(DetailAST ast)
      Finds next token after the given one.
      Parameters:
      ast - the given node.
      Returns:
      the token which represents next lexical item.