|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.puppycrawl.tools.checkstyle.checks.indentation.ExpressionHandler
Abstract base class for all handlers.
Constructor Summary | |
ExpressionHandler(IndentationCheck aIndentCheck,
java.lang.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 |
checkModifiers()
Check the indentation level of modifiers. |
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(java.lang.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,
java.lang.String aSubtypeName,
int aActualLevel)
Log an indentation error. |
protected void |
logError(DetailAST aAst,
java.lang.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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ExpressionHandler(IndentationCheck aIndentCheck, java.lang.String aTypeName, DetailAST aExpr, ExpressionHandler aParent)
aIndentCheck
- the indentation checkaTypeName
- the name of the handleraExpr
- the abstract syntax treeaParent
- the parent handlerMethod Detail |
public final IndentLevel getLevel()
protected IndentLevel getLevelImpl()
public IndentLevel suggestedChildLevel(ExpressionHandler aChild)
aChild
- child AST (so suggestion level can differ based on child
type)
protected final void logError(DetailAST aAst, java.lang.String aSubtypeName, int aActualLevel)
aAst
- the expression that caused the erroraSubtypeName
- the type of the expressionaActualLevel
- the actual indent level of the expressionprotected final void logError(DetailAST aAst, java.lang.String aSubtypeName, int aActualLevel, IndentLevel aExpectedLevel)
aAst
- the expression that caused the erroraSubtypeName
- the type of the expressionaActualLevel
- the actual indent level of the expressionaExpectedLevel
- the expected indent level of the expressionprotected final boolean startsLine(DetailAST aAst)
aAst
- the expression to check
protected final int getLineStart(DetailAST aAst)
aAst
- the expression to find the start of the line for
protected final void checkLinesIndent(int aStartLine, int aEndLine, IndentLevel aIndentLevel)
aStartLine
- the first line to checkaEndLine
- the last line to checkaIndentLevel
- the required indent levelprotected boolean shouldIncreaseIndent()
protected final int getLineStart(java.lang.String aLine)
aLine
- the specified line number
protected final void checkChildren(DetailAST aParent, int[] aTokenTypes, IndentLevel aStartLevel, boolean aFirstLineMatches, boolean aAllowNesting)
aParent
- the parent whose children we are checkingaTokenTypes
- the token types to checkaStartLevel
- the starting indent levelaFirstLineMatches
- whether or not the first line needs to matchaAllowNesting
- whether or not nested children are allowedprotected final void checkExpressionSubtree(DetailAST aTree, IndentLevel aLevel, boolean aFirstLineMatches, boolean aAllowNesting)
aTree
- the expression subtree to checkaLevel
- the indentation levelaFirstLineMatches
- whether or not the first line has to matchaAllowNesting
- whether or not subtree nesting is allowedprotected final int getFirstLine(int aStartLine, DetailAST aTree)
aStartLine
- the line we are starting fromaTree
- the expression to find the first line for
protected final int expandedTabsColumnNo(DetailAST aAst)
aAst
- the expression to find the start of
protected final void findSubtreeLines(LineSet aLines, DetailAST aTree, boolean aAllowNesting)
aLines
- the set of lines to add toaTree
- the subtree to examineaAllowNesting
- whether or not to allow nested subtreesprotected final void checkModifiers()
public abstract void checkIndentation()
protected final IndentationCheck getIndentCheck()
protected final DetailAST getMainAst()
protected final ExpressionHandler getParent()
protected final int getBasicOffset()
IndentationCheck
property.
IndentationCheck
protected final int getBraceAdjustement()
IndentationCheck
property.
IndentationCheck
|
Back to the Checkstyle Home Page | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |