Class LambdaHandler

    • Field Detail

      • isLambdaCorrectlyIndented

        private boolean isLambdaCorrectlyIndented
        Checks whether the lambda is correctly indented, this variable get its value from checking the lambda handler's indentation, and it is being used in aligning the lambda's children. A true value depicts lambda is correctly aligned without giving any errors. This is updated to false where there is any Indentation error log.
    • Constructor Detail

      • LambdaHandler

        public LambdaHandler​(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

      • isNonAcceptableIndent

        private boolean isNonAcceptableIndent​(int astColumnNo,
                                              IndentLevel level)
        Checks that given indent is acceptable or not.
        Parameters:
        astColumnNo - indent value to check
        level - indent level
        Returns:
        true if indent is not acceptable
      • checkLineWrappedLambda

        private void checkLineWrappedLambda​(boolean isSwitchRuleLambda,
                                            int mainAstColumnNo)
        This method checks a line wrapped lambda, whether it is a lambda expression or switch rule lambda.
        Parameters:
        isSwitchRuleLambda - if mainAst is a switch rule lambda
        mainAstColumnNo - the column number of the lambda we are checking