public class NewHandler extends AbstractExpressionHandler
| Modifier and Type | Field and Description |
|---|---|
private DetailAST |
mainAst
The AST which is handled by this handler.
|
| Constructor and Description |
|---|
NewHandler(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 boolean |
doesChainedMethodNeedsLineWrapping()
The function checks if the new keyword is a child of chained method calls,
it checks if the new is directly followed by equal operator or return operator.
|
protected IndentLevel |
getIndentImpl()
Compute the indentation amount for this handler.
|
private int |
getLineWrappingIndent()
A shortcut for
IndentationCheck property. |
IndentLevel |
getSuggestedChildIndent(AbstractExpressionHandler child)
Indentation level suggested for a child element.
|
protected boolean |
shouldIncreaseIndent()
Checks that indentation should be increased after first line in checkLinesIndent().
|
checkChildren, checkExpressionSubtree, checkLeftParen, checkModifiers, checkRightParen, checkWrappingIndentation, checkWrappingIndentation, expandedTabsColumnNo, findSubtreeAst, getBasicOffset, getBraceAdjustment, getFirstAstNode, getFirstLine, getFirstToken, getIndent, getIndentCheck, getLineStart, getLineStart, getMainAst, getParent, isOnStartOfLine, logError, logErrorpublic NewHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
indentCheck - the indentation checkast - the abstract syntax treeparent - the parent handlerpublic void checkIndentation()
AbstractExpressionHandlercheckIndentation in class AbstractExpressionHandlerpublic IndentLevel getSuggestedChildIndent(AbstractExpressionHandler child)
AbstractExpressionHandlergetSuggestedChildIndent in class AbstractExpressionHandlerchild - child AST (so suggestion level can differ based on child
type)protected IndentLevel getIndentImpl()
AbstractExpressionHandlergetIndentImpl in class AbstractExpressionHandlerprivate int getLineWrappingIndent()
IndentationCheck property.IndentationCheckprotected boolean shouldIncreaseIndent()
AbstractExpressionHandlershouldIncreaseIndent in class AbstractExpressionHandlerprivate boolean doesChainedMethodNeedsLineWrapping()
Copyright © 2001-2022. All Rights Reserved.