Class IfHandler

    • Constructor Detail

      • IfHandler

        public IfHandler​(IndentationCheck indentCheck,
                         DetailAST ast,
                         AbstractExpressionHandler parent)
        Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.
        Parameters:
        indentCheck - the indentation check
        ast - the abstract syntax tree
        parent - the parent handler
    • Method Detail

      • isIfAfterElse

        private boolean isIfAfterElse()
        Determines if this 'if' statement is part of an 'else' clause and on the same line.
        Returns:
        true if this 'if' is part of an 'else', false otherwise
      • checkCondExpr

        private void checkCondExpr()
        Check the indentation of the conditional expression.
      • getIfStatementRightParen

        private static DetailAST getIfStatementRightParen​(DetailAST literalIfAst)
        Returns right parenthesis of if statement.
        Parameters:
        literalIfAst - literal-if ast node(TokenTypes.LITERAL_IF)
        Returns:
        right parenthesis of if statement.