checkChildren
protected final void checkChildren(DetailAST aParent,
int[] aTokenTypes,
IndentLevel aStartLevel,
boolean aFirstLineMatches,
boolean aAllowNesting)
Check the indent level of the children of the specified parent
expression.
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 allowed
checkExpressionSubtree
protected final void checkExpressionSubtree(DetailAST aTree,
IndentLevel aLevel,
boolean aFirstLineMatches,
boolean aAllowNesting)
Check the indentation level for an expression subtree.
aTree
- the expression subtree to checkaLevel
- the indentation levelaFirstLineMatches
- whether or not the first line has to matchaAllowNesting
- whether or not subtree nesting is allowed
checkIndentation
public abstract void checkIndentation()
Check the indentation of the expression we are handling.
checkLParen
protected final void checkLParen(DetailAST aLparen)
Check the indentation of the left parenthesis.
aLparen
- parenthesis to check
checkLinesIndent
protected final void checkLinesIndent(int aStartLine,
int aEndLine,
IndentLevel aIndentLevel)
Check the indentation of consecutive lines for the expression we are
handling.
aStartLine
- the first line to checkaEndLine
- the last line to checkaIndentLevel
- the required indent level
checkModifiers
protected final void checkModifiers()
Check the indentation level of modifiers.
checkRParen
protected final void checkRParen(DetailAST aLparen,
DetailAST aRparen)
Check the indentation of the right parenthesis.
aLparen
- left parenthesis associated with aRparenaRparen
- parenthesis to check
expandedTabsColumnNo
protected final int expandedTabsColumnNo(DetailAST aAST)
Get the column number for the start of a given expression, expanding
tabs out into spaces in the process.
aAST
- the expression to find the start of
- the column number for the start of the expression
findSubtreeLines
protected final void findSubtreeLines(LineSet aLines,
DetailAST aTree,
boolean aAllowNesting)
Find the set of lines for a given subtree.
aLines
- the set of lines to add toaTree
- the subtree to examineaAllowNesting
- whether or not to allow nested subtrees
getBasicOffset
protected final int getBasicOffset()
A shortcut for IndentationCheck
property.
- value of basicOffset property of
IndentationCheck
getBraceAdjustement
protected final int getBraceAdjustement()
A shortcut for IndentationCheck
property.
- value of braceAdjustment property
of
IndentationCheck
getFirstLine
protected final int getFirstLine(int aStartLine,
DetailAST aTree)
Get the first line for a given expression.
aStartLine
- the line we are starting fromaTree
- the expression to find the first line for
- the first line of the expression
getIndentCheck
protected final IndentationCheck getIndentCheck()
Accessor for the IndentCheck attribute.
- the IndentCheck attribute
getLevel
public final IndentLevel getLevel()
Get the indentation amount for this handler. For performance reasons,
this value is cached. The first time this method is called, the
indentation amount is computed and stored. On further calls, the stored
value is returned.
- the expected indentation amount
getLevelImpl
protected IndentLevel getLevelImpl()
Compute the indentation amount for this handler.
- the expected indentation amount
getLineStart
protected final int getLineStart(String aLine)
Get the start of the specified line.
aLine
- the specified line number
- the start of the specified line
getLineStart
protected final int getLineStart(DetailAST aAst)
Get the start of the line for the given expression.
aAst
- the expression to find the start of the line for
- the start of the line for the given expression
getMainAst
protected final DetailAST getMainAst()
Accessor for the MainAst attribute.
getParent
protected final ExpressionHandler getParent()
Accessor for the Parent attribute.
logError
protected final void logError(DetailAST aAst,
String aSubtypeName,
int aActualLevel)
Log an indentation error.
aAst
- the expression that caused the erroraSubtypeName
- the type of the expressionaActualLevel
- the actual indent level of the expression
logError
protected final void logError(DetailAST aAst,
String aSubtypeName,
int aActualLevel,
IndentLevel aExpectedLevel)
Log an indentation error.
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 expression
shouldIncreaseIndent
protected boolean shouldIncreaseIndent()
- true if indentation should be increased after
fisrt line in checkLinesIndent()
false otherwise
startsLine
protected final boolean startsLine(DetailAST aAst)
Determines if the given expression is at the start of a line.
aAst
- the expression to check
- true if it is, false otherwise
suggestedChildLevel
public IndentLevel suggestedChildLevel(ExpressionHandler aChild)
Indentation level suggested for a child element. Children don't have
to respect this, but most do.
aChild
- child AST (so suggestion level can differ based on child
type)
- suggested indentation for child