Class AnnotationArrayInitHandler
java.lang.Object
com.puppycrawl.tools.checkstyle.checks.indentation.AbstractExpressionHandler
com.puppycrawl.tools.checkstyle.checks.indentation.BlockParentHandler
com.puppycrawl.tools.checkstyle.checks.indentation.AnnotationArrayInitHandler
Handler for annotation array initialization blocks.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
Constant to define that the required character does not exist at any position. -
Constructor Summary
ConstructorsConstructorDescriptionAnnotationArrayInitHandler
(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent) Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Determines if child elements within the expression may be nested.protected IndentLevel
Get the expected indentation level for the curly braces.private int
A shortcut forIndentationCheck
property.protected IndentLevel
Gets indentation level expected for children.protected IndentLevel
Compute the indentation amount for this handler.protected DetailAST
Get the left curly brace portion of the expression we are handling.private int
A shortcut forIndentationCheck
property.protected DetailAST
Get the child element representing the list of statements.private int
getNextFirstNonBlankOnLineAfter
(int lineNo, int columnNo) Returns column number of first non-blank char after specified column on specified line or -1 if such char doesn't exist.protected DetailAST
Get the right curly brace portion of the expression we are handling.protected DetailAST
Get the top level expression being managed by this handler.Methods inherited from class com.puppycrawl.tools.checkstyle.checks.indentation.BlockParentHandler
checkIndentation, checkTopLevelToken, getCheckedChildren, getNonListChild, getSuggestedChildIndent
Methods inherited from class com.puppycrawl.tools.checkstyle.checks.indentation.AbstractExpressionHandler
checkChildren, checkExpressionSubtree, checkLeftParen, checkModifiers, checkRightParen, checkWrappingIndentation, checkWrappingIndentation, expandedTabsColumnNo, findSubtreeAst, getBasicOffset, getBraceAdjustment, getFirstAstNode, getFirstLine, getFirstToken, getIndent, getIndentCheck, getLineStart, getLineStart, getMainAst, getParent, isOnStartOfLine, logError, logError, shouldIncreaseIndent
-
Field Details
-
NOT_EXIST
Constant to define that the required character does not exist at any position.- See Also:
-
-
Constructor Details
-
AnnotationArrayInitHandler
public AnnotationArrayInitHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent) Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.- Parameters:
indentCheck
- the indentation checkast
- the abstract syntax treeparent
- the parent handler
-
-
Method Details
-
getIndentImpl
Description copied from class:AbstractExpressionHandler
Compute the indentation amount for this handler.- Overrides:
getIndentImpl
in classAbstractExpressionHandler
- Returns:
- the expected indentation amount
-
getTopLevelAst
Description copied from class:BlockParentHandler
Get the top level expression being managed by this handler.- Overrides:
getTopLevelAst
in classBlockParentHandler
- Returns:
- the top level expression
-
getLeftCurly
Description copied from class:BlockParentHandler
Get the left curly brace portion of the expression we are handling.- Overrides:
getLeftCurly
in classBlockParentHandler
- Returns:
- the left curly brace expression
-
curlyIndent
Description copied from class:BlockParentHandler
Get the expected indentation level for the curly braces.- Overrides:
curlyIndent
in classBlockParentHandler
- Returns:
- the curly brace indentation level
-
getRightCurly
Description copied from class:BlockParentHandler
Get the right curly brace portion of the expression we are handling.- Overrides:
getRightCurly
in classBlockParentHandler
- Returns:
- the right curly brace expression
-
canChildrenBeNested
Description copied from class:BlockParentHandler
Determines if child elements within the expression may be nested.- Overrides:
canChildrenBeNested
in classBlockParentHandler
- Returns:
- false
-
getListChild
Description copied from class:BlockParentHandler
Get the child element representing the list of statements.- Overrides:
getListChild
in classBlockParentHandler
- Returns:
- the statement list child
-
getChildrenExpectedIndent
Description copied from class:BlockParentHandler
Gets indentation level expected for children.- Overrides:
getChildrenExpectedIndent
in classBlockParentHandler
- Returns:
- indentation level expected for children
-
getNextFirstNonBlankOnLineAfter
Returns column number of first non-blank char after specified column on specified line or -1 if such char doesn't exist.- Parameters:
lineNo
- number of line on which we searchcolumnNo
- number of column after which we search- Returns:
- column number of first non-blank char after specified column on specified line or -1 if such char doesn't exist.
-
getLineWrappingIndentation
A shortcut forIndentationCheck
property.- Returns:
- value of lineWrappingIndentation property
of
IndentationCheck
-
getArrayInitIndentation
A shortcut forIndentationCheck
property.- Returns:
- value of arrayInitIndent property
of
IndentationCheck
-