public class LambdaHandler extends AbstractExpressionHandler
| Modifier and Type | Field and Description |
|---|---|
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.
|
| Constructor and Description |
|---|
LambdaHandler(IndentationCheck indentCheck,
DetailAST ast,
AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check,
abstract syntax tree, and parent handler.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkIndentation()
Check the indentation of the expression we are handling.
|
private void |
checkLineWrappedLambda(boolean isSwitchRuleLambda,
int mainAstColumnNo)
This method checks a line wrapped lambda, whether it is a lambda
expression or switch rule lambda.
|
protected IndentLevel |
getIndentImpl()
Compute the indentation amount for this handler.
|
IndentLevel |
getSuggestedChildIndent(AbstractExpressionHandler child)
Indentation level suggested for a child element.
|
private boolean |
isNonAcceptableIndent(int astColumnNo,
IndentLevel level)
Checks that given indent is acceptable or not.
|
checkChildren, checkExpressionSubtree, checkLeftParen, checkModifiers, checkRightParen, checkWrappingIndentation, checkWrappingIndentation, expandedTabsColumnNo, findSubtreeAst, getBasicOffset, getBraceAdjustment, getFirstAstNode, getFirstLine, getFirstToken, getIndent, getIndentCheck, getLineStart, getLineStart, getMainAst, getParent, isOnStartOfLine, logError, logError, shouldIncreaseIndentprivate boolean isLambdaCorrectlyIndented
public LambdaHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
indentCheck - the indentation checkast - the abstract syntax treeparent - the parent handlerpublic IndentLevel getSuggestedChildIndent(AbstractExpressionHandler child)
AbstractExpressionHandlergetSuggestedChildIndent in class AbstractExpressionHandlerchild - child AST (so suggestion level can differ based on child
type)protected IndentLevel getIndentImpl()
getIndentImpl in class AbstractExpressionHandlerpublic void checkIndentation()
AbstractExpressionHandlercheckIndentation in class AbstractExpressionHandlerprivate boolean isNonAcceptableIndent(int astColumnNo, IndentLevel level)
astColumnNo - indent value to checklevel - indent levelprivate void checkLineWrappedLambda(boolean isSwitchRuleLambda, int mainAstColumnNo)
isSwitchRuleLambda - if mainAst is a switch rule lambdamainAstColumnNo - the column number of the lambda we are checkingCopyright © 2001-2022. All Rights Reserved.