com.puppycrawl.tools.checkstyle.checks.indentation
public abstract class ExpressionHandler extends Object
Constructor Summary | |
---|---|
ExpressionHandler(IndentationCheck aIndentCheck, String aTypeName, DetailAST aExpr, ExpressionHandler aParent)
Construct an instance of this handler with the given indentation check,
name, abstract syntax tree, and parent handler.
|
Method Summary | |
---|---|
protected void | checkChildren(DetailAST aParent, int[] aTokenTypes, IndentLevel aStartLevel, boolean aFirstLineMatches, boolean aAllowNesting)
Check the indent level of the children of the specified parent
expression.
|
protected void | checkExpressionSubtree(DetailAST aTree, IndentLevel aLevel, boolean aFirstLineMatches, boolean aAllowNesting)
Check the indentation level for an expression subtree.
|
abstract void | checkIndentation()
Check the indentation of the expression we are handling. |
protected void | checkLinesIndent(int aStartLine, int aEndLine, IndentLevel aIndentLevel)
Check the indentation of consecutive lines for the expression we are
handling.
|
protected void | checkLParen(DetailAST aLparen)
Check the indentation of the left parenthesis. |
protected void | checkModifiers()
Check the indentation level of modifiers. |
protected void | checkRParen(DetailAST aLparen, DetailAST aRparen)
Check the indentation of the right parenthesis. |
protected int | expandedTabsColumnNo(DetailAST aAST)
Get the column number for the start of a given expression, expanding
tabs out into spaces in the process.
|
protected void | findSubtreeLines(LineSet aLines, DetailAST aTree, boolean aAllowNesting)
Find the set of lines for a given subtree.
|
protected int | getBasicOffset()
A shortcut for IndentationCheck property. |
protected int | getBraceAdjustement()
A shortcut for IndentationCheck property. |
protected int | getFirstLine(int aStartLine, DetailAST aTree)
Get the first line for a given expression.
|
protected IndentationCheck | getIndentCheck()
Accessor for the IndentCheck attribute.
|
IndentLevel | getLevel()
Get the indentation amount for this handler. |
protected IndentLevel | getLevelImpl()
Compute the indentation amount for this handler.
|
protected int | getLineStart(DetailAST aAst)
Get the start of the line for the given expression.
|
protected int | getLineStart(String aLine)
Get the start of the specified line.
|
protected DetailAST | getMainAst()
Accessor for the MainAst attribute.
|
protected ExpressionHandler | getParent()
Accessor for the Parent attribute.
|
protected void | logError(DetailAST aAst, String aSubtypeName, int aActualLevel)
Log an indentation error.
|
protected void | logError(DetailAST aAst, String aSubtypeName, int aActualLevel, IndentLevel aExpectedLevel)
Log an indentation error.
|
protected boolean | shouldIncreaseIndent() |
protected boolean | startsLine(DetailAST aAst)
Determines if the given expression is at the start of a line.
|
IndentLevel | suggestedChildLevel(ExpressionHandler aChild)
Indentation level suggested for a child element. |
Parameters: aIndentCheck the indentation check aTypeName the name of the handler aExpr the abstract syntax tree aParent the parent handler
Parameters: aParent the parent whose children we are checking aTokenTypes the token types to check aStartLevel the starting indent level aFirstLineMatches whether or not the first line needs to match aAllowNesting whether or not nested children are allowed
Parameters: aTree the expression subtree to check aLevel the indentation level aFirstLineMatches whether or not the first line has to match aAllowNesting whether or not subtree nesting is allowed
Parameters: aStartLine the first line to check aEndLine the last line to check aIndentLevel the required indent level
Parameters: aLparen parenthesis to check
Parameters: aRparen parenthesis to check aLparen left parenthesis associated with aRparen
Parameters: aAST the expression to find the start of
Returns: the column number for the start of the expression
Parameters: aLines the set of lines to add to aTree the subtree to examine aAllowNesting whether or not to allow nested subtrees
IndentationCheck
property.Returns: value of basicOffset property of IndentationCheck
IndentationCheck
property.Returns: value of braceAdjustment property
of IndentationCheck
Parameters: aStartLine the line we are starting from aTree the expression to find the first line for
Returns: the first line of the expression
Returns: the IndentCheck attribute
Returns: the expected indentation amount
Returns: the expected indentation amount
Parameters: aAst the expression to find the start of the line for
Returns: the start of the line for the given expression
Parameters: aLine the specified line number
Returns: the start of the specified line
Returns: the MainAst attribute
Returns: the Parent attribute
Parameters: aAst the expression that caused the error aSubtypeName the type of the expression aActualLevel the actual indent level of the expression
Parameters: aAst the expression that caused the error aSubtypeName the type of the expression aActualLevel the actual indent level of the expression aExpectedLevel the expected indent level of the expression
Returns: true if indentation should be increased after fisrt line in checkLinesIndent() false otherwise
Parameters: aAst the expression to check
Returns: true if it is, false otherwise
Parameters: aChild child AST (so suggestion level can differ based on child type)
Returns: suggested indentation for child