Uses of Class
com.puppycrawl.tools.checkstyle.api.DetailAST
-
Packages that use DetailAST Package Description com.puppycrawl.tools.checkstyle Contains the implementation of the Checkstyle framework.com.puppycrawl.tools.checkstyle.api Contains the core API to be used to implement checks.com.puppycrawl.tools.checkstyle.checks Contains the checks that are bundled with the main distribution.com.puppycrawl.tools.checkstyle.checks.annotation Contains the Annotation checks that are bundled with the main distribution.com.puppycrawl.tools.checkstyle.checks.blocks Contains the Block checks that are bundled with the main distribution.com.puppycrawl.tools.checkstyle.checks.coding Contains the Coding checks that are bundled with the main distribution.com.puppycrawl.tools.checkstyle.checks.design Contains the Class Design checks that are bundled with the main distribution.com.puppycrawl.tools.checkstyle.checks.imports Contains the Imports checks that are bundled with the main distribution.com.puppycrawl.tools.checkstyle.checks.indentation Contains all classes required for the indentation check.com.puppycrawl.tools.checkstyle.checks.javadoc Contains the Javadoc checks that are bundled with the main distribution.com.puppycrawl.tools.checkstyle.checks.metrics Contains the Metrics checks that are bundled with the main distribution.com.puppycrawl.tools.checkstyle.checks.modifier Contains the modifier checks that are bundled with the main distribution.com.puppycrawl.tools.checkstyle.checks.naming Contains the Naming conventions checks that are bundled with the main distribution.com.puppycrawl.tools.checkstyle.checks.regexp Contains the regular expression checks that are bundled with the main distribution.com.puppycrawl.tools.checkstyle.checks.sizes Contains the Size Violations checks that are bundled with the main distribution.com.puppycrawl.tools.checkstyle.checks.whitespace Contains the Whitespace checks that are bundled with the main distribution.com.puppycrawl.tools.checkstyle.grammars Contains the grammar used by the Checkstyle framework.com.puppycrawl.tools.checkstyle.gui User interface classes for CheckStyle.com.puppycrawl.tools.checkstyle.utils Contains utils classes for checkstyle. -
-
Uses of DetailAST in com.puppycrawl.tools.checkstyle
Methods in com.puppycrawl.tools.checkstyle that return DetailAST Modifier and Type Method Description private static DetailAST
TreeWalker. appendHiddenCommentNodes(DetailAST root)
Appends comment nodes to existing AST.private static DetailAST
TreeWalker. createBlockCommentNode(antlr.Token token)
Create block comment from token.private static DetailAST
TreeWalker. createCommentAstFromToken(antlr.Token token)
Create comment AST from token.private static DetailAST
DetailNodeTreeStringPrinter. createFakeBlockComment(java.lang.String content)
Creates DetailAST block comment to pass it to the Javadoc parser.private static DetailAST
TreeWalker. createSlCommentNode(antlr.Token token)
Create single-line comment from token.static DetailAST
TreeWalker. parse(FileContents contents)
Static helper method to parses a Java source file.private static DetailAST
AstTreeStringPrinter. parseFile(java.io.File file, boolean withComments)
Parse a file and return the parse tree.private static DetailAST
AstTreeStringPrinter. parseFileText(FileText text, boolean withComments)
Parse a text and return the parse tree.static DetailAST
TreeWalker. parseWithComments(FileContents contents)
Parses Java source file.Methods in com.puppycrawl.tools.checkstyle with parameters of type DetailAST Modifier and Type Method Description private static DetailAST
TreeWalker. appendHiddenCommentNodes(DetailAST root)
Appends comment nodes to existing AST.private static java.lang.String
AstTreeStringPrinter. getIndentation(DetailAST ast)
Get indentation for an AST node.private java.util.Collection<AbstractCheck>
TreeWalker. getListOfChecks(DetailAST ast, TreeWalker.AstState astState)
Method returns list of checks.private static java.lang.String
AstTreeStringPrinter. getNodeInfo(DetailAST node)
Get string representation of the node as token name, node text, line number and column number.private static boolean
TreeWalker. isPositionGreater(DetailAST ast1, DetailAST ast2)
Checks if position of first DetailAST is greater than position of second DetailAST.private void
TreeWalker. notifyBegin(DetailAST rootAST, FileContents contents, TreeWalker.AstState astState)
Notify checks that we are about to begin walking a tree.private void
TreeWalker. notifyEnd(DetailAST rootAST, TreeWalker.AstState astState)
Notify checks that we have finished walking a tree.private void
TreeWalker. notifyLeave(DetailAST ast, TreeWalker.AstState astState)
Notify checks that leaving a node.private void
TreeWalker. notifyVisit(DetailAST ast, TreeWalker.AstState astState)
Notify checks that visiting a node.private static java.lang.String
AstTreeStringPrinter. parseAndPrintJavadocTree(DetailAST node)
Parses block comment as javadoc and prints its tree.static DetailNode
DetailNodeTreeStringPrinter. parseJavadocAsDetailNode(DetailAST blockComment)
Parse block comment DetailAST as Javadoc DetailNode tree.JavadocDetailNodeParser.ParseStatus
JavadocDetailNodeParser. parseJavadocAsDetailNode(DetailAST javadocCommentAst)
Parses Javadoc comment as DetailNode tree.private static java.lang.String
AstTreeStringPrinter. printJavaAndJavadocTree(DetailAST ast)
Prints full tree (java + comments + javadoc) of the DetailAST.private static java.lang.String
AstTreeStringPrinter. printTree(DetailAST ast)
Print AST.private void
TreeWalker. processIter(DetailAST root, TreeWalker.AstState astState)
Processes a node calling interested checks at each node.private void
TreeWalker. walk(DetailAST ast, FileContents contents, TreeWalker.AstState astState)
Initiates the walk of an AST. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.api
Fields in com.puppycrawl.tools.checkstyle.api declared as DetailAST Modifier and Type Field Description private DetailAST
DetailAST. parent
The parent token.private DetailAST
DetailAST. previousSibling
Previous sibling.Methods in com.puppycrawl.tools.checkstyle.api that return DetailAST Modifier and Type Method Description DetailAST
DetailAST. findFirstToken(int type)
Returns the first child token that makes a specified type.DetailAST
DetailAST. getFirstChild()
DetailAST
DetailAST. getLastChild()
Gets the last child node.DetailAST
DetailAST. getNextSibling()
DetailAST
DetailAST. getParent()
Returns the parent token.DetailAST
DetailAST. getPreviousSibling()
Returns the previous sibling or null if no such sibling exists.Methods in com.puppycrawl.tools.checkstyle.api with parameters of type DetailAST Modifier and Type Method Description void
DetailAST. addNextSibling(DetailAST ast)
Add next sibling.void
DetailAST. addPreviousSibling(DetailAST ast)
Add previous sibling.private void
FullIdent. append(DetailAST ast)
Append the specified token and also recalibrate the first line and column.void
AbstractCheck. beginTree(DetailAST rootAST)
Called before the starting to process a tree.private static void
DetailAST. clearChildCountCache(DetailAST ast)
Clears the child count for the ast instance.static FullIdent
FullIdent. createFullIdent(DetailAST ast)
Creates a new FullIdent starting from the specified node.static FullIdent
FullIdent. createFullIdentBelow(DetailAST ast)
Creates a new FullIdent starting from the child of the specified node.private static void
FullIdent. extractFullIdent(FullIdent full, DetailAST ast)
Recursively extract a FullIdent.private static int
DetailAST. findColumnNo(DetailAST ast)
Finds column number in the first non-comment node.private static int
DetailAST. findLineNo(DetailAST ast)
Finds line number in the first non-comment node.void
AbstractCheck. finishTree(DetailAST rootAST)
Called after finished processing a tree.void
AbstractCheck. leaveToken(DetailAST ast)
Called after all the child nodes have been process.protected void
AbstractViolationReporter. log(DetailAST ast, java.lang.String key, java.lang.Object... args)
Helper method to log a LocalizedMessage.private void
DetailAST. setParent(DetailAST parent)
Set the parent token.void
AbstractCheck. visitToken(DetailAST ast)
Called to process a token. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks
Fields in com.puppycrawl.tools.checkstyle.checks declared as DetailAST Modifier and Type Field Description private DetailAST
OuterTypeFilenameCheck. wrongType
Outer type with mismatched file name.Fields in com.puppycrawl.tools.checkstyle.checks with type parameters of type DetailAST Modifier and Type Field Description private java.util.Map<DetailAST,AbstractDeclarationCollector.LexicalFrame>
AbstractDeclarationCollector. frames
Deprecated.Tree of all the parsed frames.Methods in com.puppycrawl.tools.checkstyle.checks that return DetailAST Modifier and Type Method Description private static DetailAST
SuppressWarningsHolder. getAcceptableParent(DetailAST child)
Returns parent of given ast if parent has one of the following types: ANNOTATION_DEF, PACKAGE_DEF, CLASS_DEF, ENUM_DEF, ENUM_CONSTANT_DEF, CTOR_DEF, METHOD_DEF, PARAMETER_DEF, VARIABLE_DEF, ANNOTATION_FIELD_DEF, TYPE, LITERAL_NEW, LITERAL_THROWS, TYPE_ARGUMENT, IMPLEMENTS_CLAUSE, DOT.private static DetailAST
SuppressWarningsHolder. getAnnotationTarget(DetailAST ast)
Get target of annotation.private static DetailAST
SuppressWarningsHolder. getNthChild(DetailAST ast, int index)
Returns the n'th child of an AST node.Methods in com.puppycrawl.tools.checkstyle.checks with parameters of type DetailAST Modifier and Type Method Description void
AbstractDeclarationCollector. beginTree(DetailAST rootAST)
Deprecated.void
AbstractTypeAwareCheck. beginTree(DetailAST rootAST)
Deprecated.void
AvoidEscapedUnicodeCharactersCheck. beginTree(DetailAST rootAST)
void
FileContentsHolder. beginTree(DetailAST rootAST)
void
OuterTypeFilenameCheck. beginTree(DetailAST rootAST)
void
SuppressWarningsHolder. beginTree(DetailAST rootAST)
void
TrailingCommentCheck. beginTree(DetailAST rootAST)
void
UncommentedMainCheck. beginTree(DetailAST rootAST)
private static boolean
UncommentedMainCheck. checkModifiers(DetailAST method)
Checks that method has final and static modifiers.private static boolean
UncommentedMainCheck. checkName(DetailAST method)
Checks that method name is @quot;main@quot;.private void
FinalParametersCheck. checkParam(DetailAST param)
Checks if the given parameter is final.private static boolean
UncommentedMainCheck. checkParams(DetailAST method)
Checks that method has onlyString[]
or onlyString...
param.private static boolean
UncommentedMainCheck. checkType(DetailAST method)
Checks that return type isvoid
.private static void
AbstractDeclarationCollector. collectDeclarations(java.util.Deque<AbstractDeclarationCollector.LexicalFrame> frameStack, DetailAST ast)
Deprecated.Parse the next AST for declarations.private static void
AbstractDeclarationCollector. collectVariableDeclarations(DetailAST ast, AbstractDeclarationCollector.LexicalFrame frame)
Deprecated.Collect Variable Declarations.private void
AbstractDeclarationCollector. endCollectingDeclarations(java.util.Queue<AbstractDeclarationCollector.LexicalFrame> frameStack, DetailAST ast)
Deprecated.End parsing of the AST for declarations.private static java.util.List<java.lang.String>
SuppressWarningsHolder. findAllExpressionsInChildren(DetailAST parent)
Method looks at children and returns list of expressions in strings.void
OuterTypeFilenameCheck. finishTree(DetailAST rootAST)
private static DetailAST
SuppressWarningsHolder. getAcceptableParent(DetailAST child)
Returns parent of given ast if parent has one of the following types: ANNOTATION_DEF, PACKAGE_DEF, CLASS_DEF, ENUM_DEF, ENUM_CONSTANT_DEF, CTOR_DEF, METHOD_DEF, PARAMETER_DEF, VARIABLE_DEF, ANNOTATION_FIELD_DEF, TYPE, LITERAL_NEW, LITERAL_THROWS, TYPE_ARGUMENT, IMPLEMENTS_CLAUSE, DOT.private static java.util.List<java.lang.String>
SuppressWarningsHolder. getAllAnnotationValues(DetailAST ast)
Get all annotation values.private static DetailAST
SuppressWarningsHolder. getAnnotationTarget(DetailAST ast)
Get target of annotation.private static java.util.List<java.lang.String>
SuppressWarningsHolder. getAnnotationValues(DetailAST ast)
Returns the annotation values represented by an AST.private static java.lang.String
SuppressWarningsHolder. getIdentifier(DetailAST ast)
Returns the Java identifier represented by an AST.private static DetailAST
SuppressWarningsHolder. getNthChild(DetailAST ast, int index)
Returns the n'th child of an AST node.private static java.lang.String
SuppressWarningsHolder. getStringExpr(DetailAST ast)
Returns the literal string expression represented by an AST.private boolean
AvoidEscapedUnicodeCharactersCheck. hasTrailComment(DetailAST ast)
Check if trail comment is present after ast token.private boolean
FinalParametersCheck. isIgnoredParam(DetailAST paramDef)
Checks for skip current param due to ignorePrimitiveTypes option.private static boolean
UncommentedMainCheck. isStringType(DetailAST typeAst)
Whether the type is java.lang.String.void
AbstractTypeAwareCheck. leaveToken(DetailAST ast)
Deprecated.void
UncommentedMainCheck. leaveToken(DetailAST ast)
private void
DescendantTokenCheck. logAsSeparated(DetailAST ast)
Log violations for each Token.private void
DescendantTokenCheck. logAsTotal(DetailAST ast)
Log validation as one violation.protected abstract void
AbstractTypeAwareCheck. processAST(DetailAST ast)
Deprecated.Called to process an AST when visiting it.private void
AbstractTypeAwareCheck. processClass(DetailAST ast)
Deprecated.Processes class definition.private void
AbstractTypeAwareCheck. processImport(DetailAST ast)
Deprecated.Collects the details of imports.private void
AbstractTypeAwareCheck. processPackage(DetailAST ast)
Deprecated.Collects the details of a package.private void
AbstractTypeAwareCheck. processTypeParams(DetailAST ast)
Deprecated.Process type params (if any) for given class, enum or method.private void
FinalParametersCheck. visitCatch(DetailAST catchClause)
Checks parameter of the catch block.private void
UncommentedMainCheck. visitClassDef(DetailAST classDef)
If not inner class then change current class name.private void
FinalParametersCheck. visitForEachClause(DetailAST forEachClause)
Checks parameter of the for each clause.private void
FinalParametersCheck. visitMethod(DetailAST method)
Checks parameters of the method or ctor.private void
UncommentedMainCheck. visitMethodDef(DetailAST method)
Checks method definition if this ispublic static void main(String[])
.private void
UncommentedMainCheck. visitPackageDef(DetailAST packageDef)
Sets current package.void
AbstractDeclarationCollector. visitToken(DetailAST ast)
Deprecated.void
AbstractTypeAwareCheck. visitToken(DetailAST ast)
Deprecated.void
ArrayTypeStyleCheck. visitToken(DetailAST ast)
void
AvoidEscapedUnicodeCharactersCheck. visitToken(DetailAST ast)
void
DescendantTokenCheck. visitToken(DetailAST ast)
void
FinalParametersCheck. visitToken(DetailAST ast)
void
OuterTypeFilenameCheck. visitToken(DetailAST ast)
void
SuppressWarningsHolder. visitToken(DetailAST ast)
void
TodoCommentCheck. visitToken(DetailAST ast)
void
TrailingCommentCheck. visitToken(DetailAST ast)
void
UncommentedMainCheck. visitToken(DetailAST ast)
void
UpperEllCheck. visitToken(DetailAST ast)
-
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.annotation
Methods in com.puppycrawl.tools.checkstyle.checks.annotation that return DetailAST Modifier and Type Method Description private static DetailAST
SuppressWarningsCheck. findWarningsHolder(DetailAST annotation)
Find the parent (holder) of the of the warnings (Expr).private static DetailAST
SuppressWarningsCheck. getCondLeft(DetailAST cond)
Retrieves the left side of a conditional.private static DetailAST
SuppressWarningsCheck. getCondRight(DetailAST cond)
Retrieves the right side of a conditional.private static DetailAST
SuppressWarningsCheck. getSuppressWarnings(DetailAST ast)
Gets theSuppressWarnings
annotation that is annotating the AST.Methods in com.puppycrawl.tools.checkstyle.checks.annotation with parameters of type DetailAST Modifier and Type Method Description private void
AnnotationLocationCheck. checkAnnotations(DetailAST modifierNode, int correctIndentation)
Checks annotations positions in code: 1) Checks whether the annotations locations are correct.private void
AnnotationUseStyleCheck. checkCheckClosingParens(DetailAST ast)
Checks to see if the closing parenthesis are present if required or prohibited.private void
AnnotationUseStyleCheck. checkCompactNoArrayStyle(DetailAST annotation)
Checks for compact no array style type violations.private void
AnnotationUseStyleCheck. checkCompactStyle(DetailAST annotation)
Checks for compact style type violations.private void
AnnotationUseStyleCheck. checkExpandedStyle(DetailAST annotation)
Checks for expanded style type violations.private void
AnnotationUseStyleCheck. checkStyleType(DetailAST annotation)
Checks to see if theAnnotationElementStyle
is correct.private void
AnnotationUseStyleCheck. checkTrailingComma(DetailAST annotation)
Checks to see if the trailing comma is present if required or prohibited.private static DetailAST
SuppressWarningsCheck. findWarningsHolder(DetailAST annotation)
Find the parent (holder) of the of the warnings (Expr).private static java.lang.String
AnnotationLocationCheck. getAnnotationName(DetailAST annotation)
Returns the name of the given annotation.private static DetailAST
SuppressWarningsCheck. getCondLeft(DetailAST cond)
Retrieves the left side of a conditional.private static DetailAST
SuppressWarningsCheck. getCondRight(DetailAST cond)
Retrieves the right side of a conditional.private static int
AnnotationLocationCheck. getExpectedAnnotationIndentation(DetailAST modifierNode)
Returns an expected annotation indentation.private static DetailAST
SuppressWarningsCheck. getSuppressWarnings(DetailAST ast)
Gets theSuppressWarnings
annotation that is annotating the AST.private static boolean
AnnotationLocationCheck. hasAnnotations(DetailAST modifierNode)
Checks whether a given modifier node has an annotation.private static boolean
AnnotationLocationCheck. hasNodeAfter(DetailAST annotation)
Checks whether an annotation node has any node after on the same line.private static boolean
AnnotationLocationCheck. hasNodeBefore(DetailAST annotation)
Checks whether an annotation node has any node before on the same line.private static boolean
AnnotationLocationCheck. hasNodeBeside(DetailAST annotation)
Checks whether an annotation node has any node before or after on the same line.static boolean
AnnotationLocationCheck. isAllowedPosition(DetailAST annotation, int... allowedPositions)
Checks whether position of annotation is allowed.private boolean
AnnotationLocationCheck. isCorrectLocation(DetailAST annotation, boolean hasParams)
Checks whether an annotation has a correct location.private static boolean
AnnotationLocationCheck. isInSpecificCodeBlock(DetailAST node, int blockType)
Checks whether the scope of a node is restricted to a specific code block.private static boolean
AnnotationLocationCheck. isParameterized(DetailAST annotation)
Checks whether an annotation has parameters.private void
AnnotationUseStyleCheck. logCommaViolation(DetailAST ast)
Logs a trailing array comma violation if one exists.void
AnnotationLocationCheck. visitToken(DetailAST ast)
void
AnnotationUseStyleCheck. visitToken(DetailAST ast)
void
MissingDeprecatedCheck. visitToken(DetailAST ast)
void
MissingOverrideCheck. visitToken(DetailAST ast)
void
PackageAnnotationCheck. visitToken(DetailAST ast)
void
SuppressWarningsCheck. visitToken(DetailAST ast)
private void
SuppressWarningsCheck. walkConditional(DetailAST cond)
Recursively walks a conditional expression checking the left and right sides, checking for matches and logging violations. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.blocks
Fields in com.puppycrawl.tools.checkstyle.checks.blocks declared as DetailAST Modifier and Type Field Description private DetailAST
RightCurlyCheck.Details. lcurly
Left curly.private DetailAST
RightCurlyCheck.Details. nextToken
Next token.private DetailAST
RightCurlyCheck.Details. rcurly
Right curly.Methods in com.puppycrawl.tools.checkstyle.checks.blocks that return DetailAST Modifier and Type Method Description private static DetailAST
LeftCurlyCheck. findLastAnnotation(DetailAST modifiers)
Find the last token of typeTokenTypes.ANNOTATION
under the given set of modifiers.private static DetailAST
EmptyBlockCheck. findLeftCurly(DetailAST ast)
Calculates the left curly corresponding to the block to be checked.private static DetailAST
LeftCurlyCheck. getFirstAnnotationOnSameLine(DetailAST annotation)
Returns first annotation on same line.private static DetailAST
RightCurlyCheck.Details. getNextToken(DetailAST ast)
Finds next token after the given one.private static DetailAST
LeftCurlyCheck. skipAnnotationOnlyLines(DetailAST ast)
Skip lines that only containTokenTypes.ANNOTATION
s.Methods in com.puppycrawl.tools.checkstyle.checks.blocks with parameters of type DetailAST Modifier and Type Method Description private static DetailAST
LeftCurlyCheck. findLastAnnotation(DetailAST modifiers)
Find the last token of typeTokenTypes.ANNOTATION
under the given set of modifiers.private static DetailAST
EmptyBlockCheck. findLeftCurly(DetailAST ast)
Calculates the left curly corresponding to the block to be checked.private static java.lang.String
EmptyCatchBlockCheck. getCommentFirstLine(DetailAST catchAst)
Gets the first line of comment in catch block.private static RightCurlyCheck.Details
RightCurlyCheck.Details. getDetails(DetailAST ast)
Collects validation Details.private static RightCurlyCheck.Details
RightCurlyCheck.Details. getDetailsForIfElse(DetailAST ast)
Collects validation details for LITERAL_IF and LITERAL_ELSE.private static RightCurlyCheck.Details
RightCurlyCheck.Details. getDetailsForLambda(DetailAST ast)
Collects validation details for Lambdas.private static RightCurlyCheck.Details
RightCurlyCheck.Details. getDetailsForLoops(DetailAST ast)
Collects validation details for loops' tokens.private static RightCurlyCheck.Details
RightCurlyCheck.Details. getDetailsForOthers(DetailAST ast)
Collects validation details for CLASS_DEF, METHOD DEF, CTOR_DEF, STATIC_INIT, and INSTANCE_INIT.private static RightCurlyCheck.Details
RightCurlyCheck.Details. getDetailsForTryCatchFinally(DetailAST ast)
Collects validation details for LITERAL_TRY, LITERAL_CATCH, and LITERAL_FINALLY.private static java.lang.String
EmptyCatchBlockCheck. getExceptionVariableName(DetailAST catchAst)
Gets variable's name associated with exception.private static DetailAST
LeftCurlyCheck. getFirstAnnotationOnSameLine(DetailAST annotation)
Returns first annotation on same line.private static DetailAST
RightCurlyCheck.Details. getNextToken(DetailAST ast)
Finds next token after the given one.private boolean
LeftCurlyCheck. hasLineBreakAfter(DetailAST leftCurly)
Checks if left curly has line break after.private static boolean
RightCurlyCheck. hasLineBreakBefore(DetailAST rightCurly)
Checks if right curly has line break before.protected boolean
EmptyBlockCheck. hasText(DetailAST slistAST)
Checks if SLIST token contains any text.private static boolean
RightCurlyCheck. isAnonInnerClassInit(DetailAST lcurly)
Checks whether lcurly is in anonymous inner class initialization.private boolean
NeedBracesCheck. isDefaultInAnnotation(DetailAST ast)
Checks if ast is the default token of an annotation field.private static boolean
RightCurlyCheck. isEmptyBody(DetailAST lcurly)
Checks if definition body is empty.private static boolean
EmptyCatchBlockCheck. isEmptyCatchBlock(DetailAST catchAst)
Checks if catch block is empty or contains only comments.private static boolean
NeedBracesCheck. isEmptyLoopBody(DetailAST ast)
Checks if current loop statement does not have body, e.g.:private static boolean
NeedBracesCheck. isSingleLineCase(DetailAST literalCase)
Checks if current case statement is single-line statement, e.g.:private static boolean
NeedBracesCheck. isSingleLineDefault(DetailAST literalDefault)
Checks if current default statement is single-line statement, e.g.:private static boolean
NeedBracesCheck. isSingleLineDoWhile(DetailAST literalDo)
Checks if current do-while statement is single-line statement, e.g.:private static boolean
NeedBracesCheck. isSingleLineElse(DetailAST literalElse)
Checks if current else statement is single-line statement, e.g.:private static boolean
NeedBracesCheck. isSingleLineFor(DetailAST literalFor)
Checks if current for statement is single-line statement, e.g.:private static boolean
NeedBracesCheck. isSingleLineIf(DetailAST literalIf)
Checks if current if statement is single-line statement, e.g.:private static boolean
NeedBracesCheck. isSingleLineLambda(DetailAST lambda)
Checks if current lambda statement is single-line statement, e.g.:private static boolean
NeedBracesCheck. isSingleLineStatement(DetailAST statement)
Checks if current statement is single-line statement, e.g.:private static boolean
NeedBracesCheck. isSingleLineWhile(DetailAST literalWhile)
Checks if current while statement is single-line statement, e.g.:private boolean
NeedBracesCheck. isSkipStatement(DetailAST statement)
Checks if current statement can be skipped by "need braces" warning.private boolean
EmptyCatchBlockCheck. isVerifiable(DetailAST emptyCatchAst, java.lang.String commentContent)
Checks if current empty catch block is verifiable according to Check's options (exception's variable name and comment format are both in consideration).private static DetailAST
LeftCurlyCheck. skipAnnotationOnlyLines(DetailAST ast)
Skip lines that only containTokenTypes.ANNOTATION
s.private void
LeftCurlyCheck. validateEol(DetailAST brace, java.lang.String braceLine)
Validate EOL case.private void
LeftCurlyCheck. validateNewLinePosition(DetailAST brace, DetailAST startToken, java.lang.String braceLine)
Validate token on new Line position.private void
LeftCurlyCheck. verifyBrace(DetailAST brace, DetailAST startToken)
Verifies that a specified left curly brace is placed correctly according to policy.private void
EmptyCatchBlockCheck. visitCatchBlock(DetailAST catchAst)
Visits catch ast node, if it is empty catch block - checks it according to Check's options.void
AvoidNestedBlocksCheck. visitToken(DetailAST ast)
void
EmptyBlockCheck. visitToken(DetailAST ast)
void
EmptyCatchBlockCheck. visitToken(DetailAST ast)
void
LeftCurlyCheck. visitToken(DetailAST ast)
void
NeedBracesCheck. visitToken(DetailAST ast)
void
RightCurlyCheck. visitToken(DetailAST ast)
Constructors in com.puppycrawl.tools.checkstyle.checks.blocks with parameters of type DetailAST Constructor Description Details(DetailAST lcurly, DetailAST rcurly, DetailAST nextToken, boolean shouldCheckLastRcurly)
Constructor. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.coding
Fields in com.puppycrawl.tools.checkstyle.checks.coding declared as DetailAST Modifier and Type Field Description private DetailAST
RequireThisCheck.AbstractFrame. frameNameIdent
Name identifier token.private DetailAST
AbstractSuperCheck.MethodNode. method
Method definition.private DetailAST
UnnecessaryParenthesesCheck. parentToSkip
Used to test if logging a warning in a parent node may be skipped because a warning was already logged on an immediate child node.private DetailAST
FinalLocalVariableCheck.FinalVariableCandidate. variableIdent
Identifier token.Fields in com.puppycrawl.tools.checkstyle.checks.coding with type parameters of type DetailAST Modifier and Type Field Description private java.util.Deque<java.util.Deque<DetailAST>>
FinalLocalVariableCheck. currentScopeAssignedVariables
Assigned variables of current scope.private java.util.Set<DetailAST>
CovariantEqualsCheck. equalsMethods
Set of equals method definitions.private java.util.Set<DetailAST>
EqualsAvoidNullCheck.FieldFrame. fields
Set of fields.private java.util.Map<DetailAST,RequireThisCheck.AbstractFrame>
RequireThisCheck. frames
Tree of all the parsed frames.private java.util.Set<DetailAST>
RequireThisCheck.ClassFrame. instanceMembers
Set of idents of instance members declared in this frame.private java.util.Set<DetailAST>
RequireThisCheck.ClassFrame. instanceMethods
Set of idents of instance methods declared in this frame.private java.util.Set<DetailAST>
IllegalInstantiationCheck. instantiations
The instantiations in the file.private java.util.Set<DetailAST>
EqualsAvoidNullCheck.FieldFrame. methodCalls
Set of equals calls.private java.util.Map<DetailAST,DetailAST>
EqualsHashCodeCheck. objBlockWithEquals
Maps OBJ_BLOCK to the method definition of equals().private java.util.Map<DetailAST,DetailAST>
EqualsHashCodeCheck. objBlockWithEquals
Maps OBJ_BLOCK to the method definition of equals().private java.util.Map<DetailAST,DetailAST>
EqualsHashCodeCheck. objBlockWithHashCode
Maps OBJ_BLOCKs to the method definition of hashCode().private java.util.Map<DetailAST,DetailAST>
EqualsHashCodeCheck. objBlockWithHashCode
Maps OBJ_BLOCKs to the method definition of hashCode().private java.util.Deque<java.util.Deque<DetailAST>>
FinalLocalVariableCheck. prevScopeUninitializedVariables
Uninitialized variables of previous scope.private java.util.Set<DetailAST>
RequireThisCheck.ClassFrame. staticMembers
Set of idents of variables declared in this frame.private java.util.Set<DetailAST>
RequireThisCheck.ClassFrame. staticMethods
Set of idents of static methods declared in this frame.private java.util.Deque<DetailAST>
FinalLocalVariableCheck.ScopeData. uninitializedVariables
Contains definitions of uninitialized variables.private java.util.Set<DetailAST>
RequireThisCheck.AbstractFrame. varIdents
Set of name of variables declared in this frame.Methods in com.puppycrawl.tools.checkstyle.checks.coding that return DetailAST Modifier and Type Method Description private static DetailAST
MagicNumberCheck. findContainingConstantDef(DetailAST ast)
Finds the constant definition that contains aAST.DetailAST
EqualsAvoidNullCheck.FieldFrame. findField(java.lang.String name)
Determines whether this FieldFrame contains the field.private static DetailAST
FinalLocalVariableCheck. findFirstUpperNamedBlock(DetailAST ast)
Find the Class, Constructor, Enum, Method, or Field in which it is defined.private static DetailAST
FinalLocalVariableCheck. findLastChildWhichContainsSpecifiedToken(DetailAST ast, int childType, int containType)
Returns the last child token that makes a specified type and contains containType in its branch.private static DetailAST
DefaultComesLastCheck. findNextSibling(DetailAST ast, int tokenType)
Return token type only if passed tokenType in argument is found or returns -1.private static DetailAST
RequireThisCheck. getBlockEndToken(DetailAST blockNameIdent, DetailAST blockStartToken)
Returns the token which ends the code block.private static DetailAST
RequireThisCheck. getCodeBlockDefinitionToken(DetailAST ident)
Returns code block definition token for current identifier.private static DetailAST
VariableDeclarationUsageDistanceCheck. getFirstNodeInsideForWhileDoWhileBlocks(DetailAST block, DetailAST variable)
Gets first Ast node inside FOR, WHILE or DO-WHILE blocks if variable usage is met only inside the block (not in its declaration!).private static DetailAST
VariableDeclarationUsageDistanceCheck. getFirstNodeInsideIfBlock(DetailAST block, DetailAST variable)
Gets first Ast node inside IF block if variable usage is met only inside the block (not in its declaration!).private static DetailAST
VariableDeclarationUsageDistanceCheck. getFirstNodeInsideSwitchBlock(DetailAST block, DetailAST variable)
Gets first Ast node inside SWITCH block if variable usage is met only inside the block (not in its declaration!).private static DetailAST
VariableDeclarationUsageDistanceCheck. getFirstNodeInsideTryCatchFinallyBlocks(DetailAST block, DetailAST variable)
Gets first Ast node inside TRY-CATCH-FINALLY blocks if variable usage is met only inside the block (not in its declaration!).DetailAST
RequireThisCheck.AbstractFrame. getFrameNameIdent()
private static DetailAST
MultipleVariableDeclarationsCheck. getLastNode(DetailAST node)
Finds sub-node for given node maximum (line, column) pair.DetailAST
AbstractSuperCheck.MethodNode. getMethod()
Returns the overriding method definition AST.private static DetailAST
IllegalTypeCheck. getNextSubTreeNode(DetailAST currentNodeAst, DetailAST subTreeRootAst)
Gets the next node of a syntactical tree (child of a current node or sibling of a current node, or sibling of a parent of a current node).private static DetailAST
EqualsAvoidNullCheck. skipVariableAssign(DetailAST currentAST)
Skips over an inner assign portion of an argument expression.Methods in com.puppycrawl.tools.checkstyle.checks.coding that return types with arguments of type DetailAST Modifier and Type Method Description private static java.util.Map.Entry<DetailAST,java.lang.Integer>
VariableDeclarationUsageDistanceCheck. calculateDistanceBetweenScopes(DetailAST ast, DetailAST variable)
Calculates distance between declaration of variable and its first usage in multiple scopes.private static java.util.Map.Entry<DetailAST,java.lang.Integer>
VariableDeclarationUsageDistanceCheck. calculateDistanceInSingleScope(DetailAST semicolonAst, DetailAST variableIdentAst)
Calculates distance between declaration of variable and its first usage in single scope.private static java.util.List<DetailAST>
ModifiedControlVariableCheck. findChildrenOfExpressionType(DetailAST ast)
Find all child of given AST of type TokenType.EXPRprivate static java.util.List<DetailAST>
IllegalCatchCheck. getAllExceptionTypes(DetailAST parentToken)
Finds all exception types in current catch.private static java.util.Set<DetailAST>
DeclarationOrderCheck. getAllTokensOfType(DetailAST ast, int tokenType)
Collects all tokens of specific type starting with the current ast node.private static java.util.Set<DetailAST>
RequireThisCheck. getAllTokensOfType(DetailAST ast, int tokenType)
Collects all tokens of specific type starting with the current ast node.private static java.util.Set<DetailAST>
RequireThisCheck. getAllTokensOfType(DetailAST ast, int tokenType, int endLineNumber)
Collects all tokens of specific type starting with the current ast node and which line number is lower or equal to the end line number.private static java.util.Set<DetailAST>
RequireThisCheck. getAllTokensWhichAreEqualToCurrent(DetailAST ast, DetailAST token, int endLineNumber)
Collects all tokens which are equal to current token starting with the current ast node and which line number is lower or equal to the end line number.java.util.Set<DetailAST>
EqualsAvoidNullCheck.FieldFrame. getMethodCalls()
Getter for frame's method calls.private static java.util.Map.Entry<java.util.List<DetailAST>,java.lang.Integer>
VariableDeclarationUsageDistanceCheck. searchVariableUsageExpressions(DetailAST variableAst, DetailAST statementAst)
Searches variable usages starting from specified statement.Methods in com.puppycrawl.tools.checkstyle.checks.coding with parameters of type DetailAST Modifier and Type Method Description void
EqualsAvoidNullCheck.FieldFrame. addField(DetailAST field)
Add field to this FieldFrame.private void
RequireThisCheck.AbstractFrame. addIdent(DetailAST identToAdd)
Add a name to the frame.void
RequireThisCheck.ClassFrame. addInstanceMember(DetailAST ident)
Adds instance member's ident.void
RequireThisCheck.ClassFrame. addInstanceMethod(DetailAST ident)
Adds instance method's name.void
EqualsAvoidNullCheck.FieldFrame. addMethodCall(DetailAST methodCall)
Add method call to this frame.void
RequireThisCheck.ClassFrame. addStaticMember(DetailAST ident)
Adds static member's ident.void
RequireThisCheck.ClassFrame. addStaticMethod(DetailAST ident)
Adds static method's name.void
AbstractNestedDepthCheck. beginTree(DetailAST rootAST)
Deprecated.void
AbstractSuperCheck. beginTree(DetailAST rootAST)
void
DeclarationOrderCheck. beginTree(DetailAST rootAST)
void
EqualsAvoidNullCheck. beginTree(DetailAST rootAST)
void
EqualsHashCodeCheck. beginTree(DetailAST rootAST)
void
HiddenFieldCheck. beginTree(DetailAST rootAST)
void
IllegalInstantiationCheck. beginTree(DetailAST rootAST)
void
ModifiedControlVariableCheck. beginTree(DetailAST rootAST)
void
MultipleStringLiteralsCheck. beginTree(DetailAST rootAST)
void
NestedForDepthCheck. beginTree(DetailAST rootAST)
void
NestedIfDepthCheck. beginTree(DetailAST rootAST)
void
NestedTryDepthCheck. beginTree(DetailAST rootAST)
void
OneStatementPerLineCheck. beginTree(DetailAST rootAST)
void
PackageDeclarationCheck. beginTree(DetailAST ast)
void
ParameterAssignmentCheck. beginTree(DetailAST rootAST)
void
RequireThisCheck. beginTree(DetailAST rootAST)
void
ReturnCountCheck. beginTree(DetailAST rootAST)
private static java.util.Map.Entry<DetailAST,java.lang.Integer>
VariableDeclarationUsageDistanceCheck. calculateDistanceBetweenScopes(DetailAST ast, DetailAST variable)
Calculates distance between declaration of variable and its first usage in multiple scopes.private static java.util.Map.Entry<DetailAST,java.lang.Integer>
VariableDeclarationUsageDistanceCheck. calculateDistanceInSingleScope(DetailAST semicolonAst, DetailAST variableIdentAst)
Calculates distance between declaration of variable and its first usage in single scope.private boolean
RequireThisCheck. canAssignValueToClassField(DetailAST ast)
Checks whether a value can be assigned to a field.private boolean
RequireThisCheck. canBeReferencedFromStaticContext(DetailAST ident)
Checks whether a field can be referenced from a static context.private void
IllegalTypeCheck. checkClassName(DetailAST ast)
Checks type of given method, parameter or variable.void
ReturnCountCheck.Context. checkCount(DetailAST ast)
Checks if number of return statements in the method are more than allowed.private void
ModifiedControlVariableCheck. checkIdent(DetailAST ast)
Check if ident is parameter.private void
ParameterAssignmentCheck. checkIdent(DetailAST ast)
Check if ident is parameter.private boolean
FallThroughCheck. checkIf(DetailAST ast, boolean useBreak, boolean useContinue)
Checks if a given IF terminated by return, throw or, if allowed break, continue.private void
OneStatementPerLineCheck. checkIfSemicolonIsInDifferentLineThanPrevious(DetailAST ast)
Checks if given semicolon is in different line than previous.private static boolean
EqualsAvoidNullCheck. checkLineNo(DetailAST field, DetailAST objCalledOn)
Check whether the field is declared before the method call in case of methods and initialization blocks.private boolean
FallThroughCheck. checkLoop(DetailAST ast)
Checks if a given loop terminated by return, throw or, if allowed break, continue.private void
EqualsAvoidNullCheck. checkMethodCall(DetailAST methodCall)
Check whether the method call should be violated.private void
OverloadMethodsDeclarationOrderCheck. checkOverloadMethodsGrouping(DetailAST objectBlock)
Checks that if overload methods are grouped together they should not be separated from each other.private static boolean
RequireThisCheck.AbstractFrame. checkPosition(DetailAST ast1, DetailAST ast2)
Whether the declaration is located before the checked ast.private boolean
FallThroughCheck. checkSlist(DetailAST slistAst, boolean useBreak, boolean useContinue)
Checks if a given SLIST terminated by return, throw or, if allowed break, continue.private boolean
FallThroughCheck. checkSwitch(DetailAST literalSwitchAst, boolean useContinue)
Checks if a given switch terminated by return, throw or, if allowed break, continue.private boolean
FallThroughCheck. checkTry(DetailAST ast, boolean useBreak, boolean useContinue)
Checks if a given try/catch/finally block terminated by return, throw or, if allowed break, continue.private static void
RequireThisCheck. collectDeclarations(java.util.Deque<RequireThisCheck.AbstractFrame> frameStack, DetailAST ast)
Parses the next AST for declarations.private static void
RequireThisCheck. collectVariableDeclarations(DetailAST ast, RequireThisCheck.AbstractFrame frame)
Collects variable declarations.private static boolean
EqualsAvoidNullCheck. containsAllSafeTokens(DetailAST expr)
Looks for all "safe" Token combinations in the argument expression branch.private static boolean
MissingSwitchDefaultCheck. containsDefaultSwitch(DetailAST caseGroupAst)
Checks if the case group or its sibling contain the 'default' switch.protected boolean
RequireThisCheck.AbstractFrame. containsFieldOrVariable(DetailAST nameToFind)
Check whether the frame contains a field or a variable with the given name.protected boolean
RequireThisCheck.ClassFrame. containsFieldOrVariable(DetailAST nameToFind)
protected boolean
RequireThisCheck.AbstractFrame. containsFieldOrVariableDef(java.util.Set<DetailAST> set, DetailAST ident)
Whether the set contains a declaration with the text of the specified IDENT ast and it is declared in a proper position.private boolean
RequireThisCheck.ClassFrame. containsMethod(DetailAST methodToFind)
Check whether the frame contains a given method.private static boolean
RequireThisCheck.ClassFrame. containsMethodDef(java.util.Set<DetailAST> set, DetailAST ident)
Whether the set contains a method definition with the same name and number of parameters.private static boolean
EqualsAvoidNullCheck. containsOneArgument(DetailAST methodCall)
Verify that method call has one argument.private static java.lang.String
IllegalTokenCheck. convertToString(DetailAST ast)
Converts given AST node to string representation.private static void
FinalLocalVariableCheck. determineAssignmentConditions(DetailAST ident, FinalLocalVariableCheck.FinalVariableCandidate candidate)
Determines identifier assignment conditions (assigned or already assigned).private void
RequireThisCheck. endCollectingDeclarations(java.util.Queue<RequireThisCheck.AbstractFrame> frameStack, DetailAST ast)
Ends parsing of the AST for declarations.private static java.util.List<DetailAST>
ModifiedControlVariableCheck. findChildrenOfExpressionType(DetailAST ast)
Find all child of given AST of type TokenType.EXPRprivate RequireThisCheck.AbstractFrame
RequireThisCheck. findClassFrame(DetailAST name, boolean lookForMethod)
Find the class frame containing declaration.private static DetailAST
MagicNumberCheck. findContainingConstantDef(DetailAST ast)
Finds the constant definition that contains aAST.java.util.Optional<FinalLocalVariableCheck.FinalVariableCandidate>
FinalLocalVariableCheck.ScopeData. findFinalVariableCandidateForAst(DetailAST ast)
Searches for final local variable candidate for ast in the scope.private static DetailAST
FinalLocalVariableCheck. findFirstUpperNamedBlock(DetailAST ast)
Find the Class, Constructor, Enum, Method, or Field in which it is defined.private RequireThisCheck.AbstractFrame
RequireThisCheck. findFrame(DetailAST name, boolean lookForMethod)
Find frame containing declaration.private static RequireThisCheck.AbstractFrame
RequireThisCheck. findFrame(RequireThisCheck.AbstractFrame frame, DetailAST name, boolean lookForMethod)
Find frame containing declaration.private static DetailAST
FinalLocalVariableCheck. findLastChildWhichContainsSpecifiedToken(DetailAST ast, int childType, int containType)
Returns the last child token that makes a specified type and contains containType in its branch.private static DetailAST
DefaultComesLastCheck. findNextSibling(DetailAST ast, int tokenType)
Return token type only if passed tokenType in argument is found or returns -1.void
EqualsAvoidNullCheck. finishTree(DetailAST ast)
void
EqualsHashCodeCheck. finishTree(DetailAST rootAST)
void
IllegalInstantiationCheck. finishTree(DetailAST rootAST)
void
MultipleStringLiteralsCheck. finishTree(DetailAST rootAST)
void
PackageDeclarationCheck. finishTree(DetailAST ast)
private static java.util.List<DetailAST>
IllegalCatchCheck. getAllExceptionTypes(DetailAST parentToken)
Finds all exception types in current catch.private static java.util.Set<DetailAST>
DeclarationOrderCheck. getAllTokensOfType(DetailAST ast, int tokenType)
Collects all tokens of specific type starting with the current ast node.private static java.util.Set<DetailAST>
RequireThisCheck. getAllTokensOfType(DetailAST ast, int tokenType)
Collects all tokens of specific type starting with the current ast node.private static java.util.Set<DetailAST>
RequireThisCheck. getAllTokensOfType(DetailAST ast, int tokenType, int endLineNumber)
Collects all tokens of specific type starting with the current ast node and which line number is lower or equal to the end line number.private static java.util.Set<DetailAST>
RequireThisCheck. getAllTokensWhichAreEqualToCurrent(DetailAST ast, DetailAST token, int endLineNumber)
Collects all tokens which are equal to current token starting with the current ast node and which line number is lower or equal to the end line number.private static DetailAST
RequireThisCheck. getBlockEndToken(DetailAST blockNameIdent, DetailAST blockStartToken)
Returns the token which ends the code block.private RequireThisCheck.AbstractFrame
RequireThisCheck. getClassFrameWhereViolationIsFound(DetailAST ast)
Returns the class frame where violation is found (where the field is used without 'this') or null otherwise.private static DetailAST
RequireThisCheck. getCodeBlockDefinitionToken(DetailAST ident)
Returns code block definition token for current identifier.private static int
VariableDeclarationUsageDistanceCheck. getDistToVariableUsageInChildNode(DetailAST childNode, DetailAST varIdent, int currentDistToVarUsage)
Returns the distance to variable usage for in the child node.private static java.lang.String
EqualsAvoidNullCheck.FieldFrame. getFieldName(DetailAST field)
Get the name of the field.private static java.lang.String
EqualsAvoidNullCheck. getFieldType(DetailAST field)
Get field type.private RequireThisCheck.AbstractFrame
RequireThisCheck. getFieldWithoutThis(DetailAST ast, int parentType)
Returns the frame where the field is declared, if the given field is used without 'this', and null otherwise.private java.util.Optional<FinalLocalVariableCheck.FinalVariableCandidate>
FinalLocalVariableCheck. getFinalCandidate(DetailAST ast)
Gets final variable candidate for ast.private static DetailAST
VariableDeclarationUsageDistanceCheck. getFirstNodeInsideForWhileDoWhileBlocks(DetailAST block, DetailAST variable)
Gets first Ast node inside FOR, WHILE or DO-WHILE blocks if variable usage is met only inside the block (not in its declaration!).private static DetailAST
VariableDeclarationUsageDistanceCheck. getFirstNodeInsideIfBlock(DetailAST block, DetailAST variable)
Gets first Ast node inside IF block if variable usage is met only inside the block (not in its declaration!).private static DetailAST
VariableDeclarationUsageDistanceCheck. getFirstNodeInsideSwitchBlock(DetailAST block, DetailAST variable)
Gets first Ast node inside SWITCH block if variable usage is met only inside the block (not in its declaration!).private static DetailAST
VariableDeclarationUsageDistanceCheck. getFirstNodeInsideTryCatchFinallyBlocks(DetailAST block, DetailAST variable)
Gets first Ast node inside TRY-CATCH-FINALLY blocks if variable usage is met only inside the block (not in its declaration!).private static java.util.Set<java.lang.String>
ModifiedControlVariableCheck. getForInitVariables(DetailAST ast)
Get all variables initialized In init part of for loop.private static java.util.Set<java.lang.String>
ModifiedControlVariableCheck. getForIteratorVariables(DetailAST ast)
Get all variables which for loop iterating part change in every loop.protected RequireThisCheck.AbstractFrame
RequireThisCheck.AbstractFrame. getIfContains(DetailAST nameToFind, boolean lookForMethod)
Check whether the frame contains a given name.protected RequireThisCheck.AbstractFrame
RequireThisCheck.ClassFrame. getIfContains(DetailAST nameToFind, boolean lookForMethod)
private static java.lang.String
IllegalTypeCheck. getImportedTypeCanonicalName(DetailAST importAst)
Gets imported type's canonical name.private static java.lang.String
VariableDeclarationUsageDistanceCheck. getInstanceName(DetailAST methodCallAst)
Get name of instance whose method is called.private static DetailAST
MultipleVariableDeclarationsCheck. getLastNode(DetailAST node)
Finds sub-node for given node maximum (line, column) pair.private RequireThisCheck.AbstractFrame
RequireThisCheck. getMethodWithoutThis(DetailAST ast)
Returns the frame where the method is declared, if the given method is used without 'this' and null otherwise.private static DetailAST
IllegalTypeCheck. getNextSubTreeNode(DetailAST currentNodeAst, DetailAST subTreeRootAst)
Gets the next node of a syntactical tree (child of a current node or sibling of a current node, or sibling of a parent of a current node).private static java.util.Set<java.lang.String>
ModifiedControlVariableCheck. getVariablesManagedByForLoop(DetailAST ast)
Determines which variable are specific to for loop and should not be change by inner loop body.private static boolean
AbstractSuperCheck. hasArguments(DetailAST methodCallDotAst)
Does method have any arguments.private boolean
FallThroughCheck. hasFallThroughComment(DetailAST currentCase, DetailAST nextCase)
Determines if the fall through case betweencurrentCase
andnextCase
is relieved by a appropriate comment.boolean
RequireThisCheck.ClassFrame. hasFinalField(DetailAST instanceMember)
Checks whether given instance member has final modifier.boolean
RequireThisCheck.ClassFrame. hasInstanceMember(DetailAST ident)
Checks if a given name is a known instance member of the class.boolean
RequireThisCheck.ClassFrame. hasInstanceMethod(DetailAST ident)
Checks if a given name is a known instance method of the class.boolean
RequireThisCheck.ClassFrame. hasStaticMethod(DetailAST ident)
Checks if a given name is a known static method of the class.private void
FinalLocalVariableCheck. insertParameter(DetailAST ast)
Insert a parameter at the topmost scope stack.private void
FinalLocalVariableCheck. insertVariable(DetailAST ast)
Insert a variable at the topmost scope stack.private static boolean
RequireThisCheck. isAnonymousClassDef(DetailAST ast)
Whether the AST is a definition of an anonymous class.private boolean
EqualsAvoidNullCheck. isCalledOnStringFieldOrVariable(DetailAST objCalledOn)
Determine, whether equals method is called on a field of String type.private static boolean
FinalLocalVariableCheck. isCaseTokenWithAnotherCaseFollowing(DetailAST ast)
If token is CASE_GROUP and there is anothercase
following.private boolean
IllegalTypeCheck. isCheckedMethod(DetailAST ast)
Returns true if method has to be checked or false.private static boolean
VariableDeclarationUsageDistanceCheck. isChild(DetailAST parent, DetailAST ast)
Checks if Ast node contains given element.private static boolean
MagicNumberCheck. isChildOf(DetailAST ast, int type)
Determines if the given AST node has a parent node with given token type code.private static boolean
InnerAssignmentCheck. isComparison(DetailAST ast)
Checks if an AST is a comparison operator.private boolean
IllegalTypeCheck. isContainVerifiableType(DetailAST modifiers)
Checks is modifiers contain verifiable type.private static boolean
EqualsHashCodeCheck. isEqualsMethod(DetailAST ast)
Determines if an AST is a valid Equals method implementation.private static boolean
UnnecessaryParenthesesCheck. isExprSurrounded(DetailAST ast)
Tests if the given expression node is surrounded by parentheses.private static boolean
MagicNumberCheck. isFieldDeclaration(DetailAST ast)
Determines whether or not the given AST is field declaration.private static boolean
FinalLocalVariableCheck. isFirstChild(DetailAST ast)
Whether the ast is the first child of its parent.private static boolean
CovariantEqualsCheck. isFirstParameterObject(DetailAST methodDefAst)
Tests whether a method's first parameter is an Object.private boolean
DeclarationOrderCheck. isForwardReference(DetailAST fieldDef)
Checks whether an identifier references a field which has been already defined in class.private static boolean
EqualsHashCodeCheck. isHashCodeMethod(DetailAST ast)
Determines if an AST is a valid HashCode method implementation.private static boolean
FinalLocalVariableCheck. isIfTokenWithAnElseFollowing(DetailAST ast)
If token is LITERAL_IF and there is anelse
following.private boolean
IllegalThrowsCheck. isIgnorableMethod(DetailAST methodDef)
Checks if current method is ignorable due to Check's properties.private boolean
HiddenFieldCheck. isIgnoredConstructorParam(DetailAST ast)
Decides whether to ignore an AST node that is the parameter of a constructor.private boolean
HiddenFieldCheck. isIgnoredParam(DetailAST ast, java.lang.String name)
Checks whether method or constructor parameter is ignored.private boolean
HiddenFieldCheck. isIgnoredParamOfAbstractMethod(DetailAST ast)
Decides whether to ignore an AST node that is the parameter of an abstract method.private boolean
HiddenFieldCheck. isIgnoredSetterParam(DetailAST ast, java.lang.String name)
Decides whether to ignore an AST node that is the parameter of a setter method, where the property setter method for field 'xyz' has name 'setXyz', one parameter named 'xyz', and return type void (default behavior) or return type is name of the class in which such method is declared (allowed only ifHiddenFieldCheck.setSetterCanReturnItsClass(boolean)
is called with value true).private static boolean
FinalLocalVariableCheck. isInAbstractOrNativeMethod(DetailAST ast)
Determines whether an AST is a descendant of an abstract or native method.private static boolean
InnerAssignmentCheck. isInContext(DetailAST ast, int[]... contextSet)
Tests whether the provided AST is in one of the given contexts.private static boolean
MagicNumberCheck. isInHashCodeMethod(DetailAST ast)
Determines whether or not the given AST is in a valid hash code method.private boolean
MagicNumberCheck. isInIgnoreList(DetailAST ast)
Decides whether the number of an AST is in the ignore list of this check.private boolean
MultipleStringLiteralsCheck. isInIgnoreOccurrenceContext(DetailAST ast)
Analyses the path from the AST root to a given AST for occurrences of the token types inMultipleStringLiteralsCheck.ignoreOccurrenceContext
.private static boolean
VariableDeclarationUsageDistanceCheck. isInitializationSequence(DetailAST variableUsageAst, java.lang.String variableName)
Processes statements until usage of variable to detect sequence of initialization methods.private static boolean
FinalLocalVariableCheck. isInitialized(DetailAST ast)
Check if VARIABLE_DEF is initialized or not.private static boolean
FinalLocalVariableCheck. isInLambda(DetailAST paramDef)
Check if current param is lambda's param.private static boolean
InnerAssignmentCheck. isInNoBraceControlStatement(DetailAST ast)
Determines if ast is in the body of a flow control statement without braces.private static boolean
FinalLocalVariableCheck. isInSpecificCodeBlock(DetailAST node, int blockType)
Checks whether the scope of a node is restricted to a specific code block.private static boolean
HiddenFieldCheck. isInStatic(DetailAST ast)
Determines whether an AST node is in a static method or static initializer.private static boolean
FinalLocalVariableCheck. isInTheSameLoop(DetailAST ast1, DetailAST ast2)
Check if both the variables are in the same loop.private static boolean
InnerAssignmentCheck. isInWhileIdiom(DetailAST ast)
Tests whether the given AST is used in the "assignment in while" idiom.private static boolean
RequireThisCheck. isLambdaParameter(DetailAST ast)
Checks if the token is a Lambda parameter.private boolean
MagicNumberCheck. isMagicNumberExists(DetailAST ast, DetailAST constantDefAST)
Is magic number some where at ast tree.private static boolean
OneStatementPerLineCheck. isMultilineStatement(DetailAST ast)
Checks whether statement is multiline.private boolean
FinalLocalVariableCheck. isMultipleTypeCatch(DetailAST parameterDefAst)
Check if given parameter definition is a multiple type catch.private static boolean
EqualsHashCodeCheck. isObjectParam(DetailAST paramNode)
Determines if an AST is a formal param of type Object.private static boolean
ExplicitInitializationCheck. isObjectType(DetailAST type)
Determines if a given type is an object type.private static boolean
EqualsAvoidNullCheck. isObjectValid(DetailAST objCalledOn)
Check whether the object equals method is called on is not a String literal and not too complex.private static boolean
OneStatementPerLineCheck. isOnTheSameLine(DetailAST ast, int lastStatementEnd, int forStatementEnd, int lambdaStatementEnd)
Checks whether two statements are on the same line.private boolean
RequireThisCheck. isOverlappingByArgument(DetailAST ast)
Checks whether an overlapping by method or constructor argument takes place.private boolean
RequireThisCheck. isOverlappingByLocalVariable(DetailAST ast)
Checks whether an overlapping by local variable takes place.private boolean
AbstractSuperCheck. isOverridingMethod(DetailAST ast)
Determines whether an AST is a method definition for this check, with 0 parameters.protected boolean
RequireThisCheck.AbstractFrame. isProperDefinition(DetailAST ident, DetailAST ast)
Whether the definition is correspondent to the IDENT.protected boolean
RequireThisCheck.ClassFrame. isProperDefinition(DetailAST ident, DetailAST ast)
private static boolean
RequireThisCheck. isReturnedVariable(RequireThisCheck.AbstractFrame currentFrame, DetailAST ident)
Checks whether the current variable is returned from the method.private boolean
AbstractSuperCheck. isSameNameMethod(DetailAST ast)
Is same name of method.private static boolean
FinalLocalVariableCheck. isSameVariables(DetailAST ast1, DetailAST ast2)
Check if both the Variables are same.private boolean
HiddenFieldCheck. isSetterMethod(DetailAST aMethodAST, java.lang.String aName)
Determine if a specific method identified by methodAST and a single variable name aName is a setter.private static boolean
RequireThisCheck.ClassFrame. isSimilarSignature(DetailAST ident, DetailAST ast)
Whether the method definition has the same name and number of parameters.private static boolean
ExplicitInitializationCheck. isSkipCase(DetailAST ast)
Checks for cases that should be skipped: no assignment, local variable, final variables.private static boolean
IllegalTypeCheck. isStarImport(DetailAST importAst)
Checks if current import is star import.private boolean
HiddenFieldCheck. isStaticFieldHiddenFromAnonymousClass(DetailAST nameAST, java.lang.String name)
Checks whether a static field is hidden from closure.private boolean
HiddenFieldCheck. isStaticOrInstanceField(DetailAST ast, java.lang.String name)
Check for static or instance field.private boolean
EqualsAvoidNullCheck. isStringFieldOrVariable(DetailAST objCalledOn)
Whether the field or the variable is of String type.private boolean
EqualsAvoidNullCheck. isStringFieldOrVariableFromClass(DetailAST objCalledOn, java.lang.String className)
Whether the field or the variable from the specified class is of String type.private boolean
EqualsAvoidNullCheck. isStringFieldOrVariableFromThisInstance(DetailAST objCalledOn)
Whether the field or the variable from THIS instance is of String type.private static boolean
EqualsAvoidNullCheck. isStringLiteral(DetailAST objCalledOn)
Checks for calling equals on String literal and anon object which cannot be null.private boolean
AbstractSuperCheck. isSuperCall(DetailAST literalSuperAst)
Determines whether a 'super' literal is a call to the super method for this check.private boolean
AbstractSuperCheck. isSuperCallInOverridingMethod(DetailAST ast)
Determines whether a super call in overriding method.private static boolean
UnnecessaryParenthesesCheck. isSurrounded(DetailAST ast)
Tests if the givenDetailAST
is surrounded by parentheses.private boolean
FallThroughCheck. isTerminated(DetailAST ast, boolean useBreak, boolean useContinue)
Checks if a given subtree terminated by return, throw or, if allowed break, continue.private static boolean
FinalLocalVariableCheck. isUseOfExternalVariableInsideLoop(DetailAST variable)
Checks whether a variable which is declared outside loop is used inside loop.private static boolean
RequireThisCheck. isUserDefinedArrangementOfThis(RequireThisCheck.AbstractFrame currentFrame, DetailAST ident)
Checks whether user arranges 'this' for variable in method, constructor, or block on his own.private static boolean
FinalLocalVariableCheck. isVariableInForInit(DetailAST variableDef)
Checks if current variable is defined infor-loop init
, e.g.:private static boolean
VariableDeclarationUsageDistanceCheck. isVariableInOperatorExpr(DetailAST operator, DetailAST variable)
Checks if variable is in operator declaration.private boolean
IllegalTypeCheck. isVerifiable(DetailAST methodOrVariableDef)
Checks if current method's return type or variable's type is verifiable according to memberModifiers option.private static boolean
ExplicitInitializationCheck. isZero(DetailAST expr)
Checks if given node contains numeric constant for zero.private static boolean
ExplicitInitializationCheck. isZeroChar(DetailAST exprStart)
Examine char literal for initializing to default value.private void
ReturnCountCheck. leave(DetailAST ast)
Checks number of return statements and restore previous context.private void
ModifiedControlVariableCheck. leaveForDef(DetailAST ast)
Pops the variables from the stack.private void
ModifiedControlVariableCheck. leaveForEach(DetailAST paramDef)
Push current variables to the stack.private void
ModifiedControlVariableCheck. leaveForIter(DetailAST ast)
Push current variables to the stack.private void
EqualsAvoidNullCheck. leaveSlist(DetailAST ast)
Determine whether SLIST begins static or non-static block.void
AbstractSuperCheck. leaveToken(DetailAST ast)
void
DeclarationOrderCheck. leaveToken(DetailAST ast)
void
EqualsAvoidNullCheck. leaveToken(DetailAST ast)
void
FinalLocalVariableCheck. leaveToken(DetailAST ast)
void
HiddenFieldCheck. leaveToken(DetailAST ast)
void
ModifiedControlVariableCheck. leaveToken(DetailAST ast)
void
NestedForDepthCheck. leaveToken(DetailAST ast)
void
NestedIfDepthCheck. leaveToken(DetailAST literalIf)
void
NestedTryDepthCheck. leaveToken(DetailAST literalTry)
void
OneStatementPerLineCheck. leaveToken(DetailAST ast)
void
ParameterAssignmentCheck. leaveToken(DetailAST ast)
void
ReturnCountCheck. leaveToken(DetailAST ast)
void
UnnecessaryParenthesesCheck. leaveToken(DetailAST ast)
private void
RequireThisCheck. logViolation(java.lang.String msgKey, DetailAST ast, RequireThisCheck.AbstractFrame frame)
Helper method to log a LocalizedMessage.protected void
AbstractNestedDepthCheck. nestIn(DetailAST ast, java.lang.String messageId)
Deprecated.Increasing current nesting depth.private void
IllegalInstantiationCheck. postProcessLiteralNew(DetailAST newTokenAst)
Processes one of the collected "new" tokens when walking tree has finished.private void
IllegalInstantiationCheck. processClassDef(DetailAST ast)
Collects classes defined in the source file.private void
DeclarationOrderCheck. processConstructor(DetailAST ast)
Processes constructor.private void
EqualsAvoidNullCheck. processFrame(DetailAST ast)
Process CLASS_DEF, METHOD_DEF, LITERAL_IF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, LITERAL_CATCH, LITERAL_TRY, CTOR_DEF, ENUM_DEF, ENUM_CONSTANT_DEF.private void
RequireThisCheck. processIdent(DetailAST ast)
Checks if a given IDENT is method call or field name which requires explicitthis
qualifier.private void
IllegalInstantiationCheck. processImport(DetailAST ast)
Perform processing for an import token.private void
HiddenFieldCheck. processLambda(DetailAST ast)
Process a lambda token.private void
EqualsAvoidNullCheck. processLiteralNew(DetailAST ast)
Determine whether LITERAL_NEW is an anonymous class definition and add it as a frame in this case.private void
IllegalInstantiationCheck. processLiteralNew(DetailAST ast)
Collects a "new" token.private void
EqualsAvoidNullCheck. processMethodCall(DetailAST methodCall)
Add the method call to the current frame if it should be processed.private void
DeclarationOrderCheck. processModifiers(DetailAST ast)
Processes modifiers.private boolean
DeclarationOrderCheck. processModifiersState(DetailAST modifierAst, DeclarationOrderCheck.ScopeState state)
Process if given modifiers are appropriate in given state (STATE_STATIC_VARIABLE_DEF
,STATE_INSTANCE_VARIABLE_DEF
, (STATE_CTOR_DEF
,STATE_METHOD_DEF
), if it is it updates states where appropriate or logs violation.private void
DeclarationOrderCheck. processModifiersSubState(DetailAST modifiersAst, DeclarationOrderCheck.ScopeState state, boolean isStateValid)
Checks if given modifiers are valid in substate of given state(Scope
), if it is it updates substate or else it logs violation.private void
IllegalInstantiationCheck. processPackageDef(DetailAST ast)
Perform processing for an package token.private void
EqualsAvoidNullCheck. processSlist(DetailAST ast)
Determine whether SLIST begins static or non-static block and add it as a frame in this case.private void
HiddenFieldCheck. processVariable(DetailAST ast)
Process a variable token.private void
FinalLocalVariableCheck. removeFinalVariableCandidateFromStack(DetailAST ast)
Removes the final variable candidate from the Stack.private void
MagicNumberCheck. reportMagicNumber(DetailAST ast)
Reports aAST as a magic number, includes unary operators as needed.private static java.util.Map.Entry<java.util.List<DetailAST>,java.lang.Integer>
VariableDeclarationUsageDistanceCheck. searchVariableUsageExpressions(DetailAST variableAst, DetailAST statementAst)
Searches variable usages starting from specified statement.private boolean
FinalLocalVariableCheck. shouldCheckEnhancedForLoopVariable(DetailAST ast)
Determines whether enhanced for-loop variable should be checked or not.private static boolean
FinalLocalVariableCheck. shouldRemoveFinalVariableCandidate(FinalLocalVariableCheck.ScopeData scopeData, DetailAST ast)
Whether the final variable candidate should be removed from the list of final local variable candidates.private static boolean
FinalLocalVariableCheck. shouldUpdateUninitializedVariables(DetailAST ast)
If token is LITERAL_IF and there is anelse
following or token is CASE_GROUP and there is anothercase
following, then update the uninitialized variables.private static DetailAST
EqualsAvoidNullCheck. skipVariableAssign(DetailAST currentAST)
Skips over an inner assign portion of an argument expression.private void
ExplicitInitializationCheck. validateNonObjects(DetailAST ast)
Checks for explicit initializations made to 'false', '0' and '\0'.private void
ParameterAssignmentCheck. visitAssign(DetailAST ast)
Checks if this is assignments of parameter.private void
IllegalTypeCheck. visitImport(DetailAST importAst)
Checks imported type (as static and star imports are not supported by Check, only type is in the consideration).
If this type is illegal due to Check's options - puts violation on it.private void
ParameterAssignmentCheck. visitIncDec(DetailAST ast)
Checks if this is increment/decrement of parameter.private void
IllegalTypeCheck. visitMethodDef(DetailAST methodDef)
Checks return type of a given method.private void
ParameterAssignmentCheck. visitMethodDef(DetailAST ast)
Creates new set of parameters and store old one in stack.private void
ReturnCountCheck. visitMethodDef(DetailAST ast)
Creates new method context and places old one on the stack.private void
ParameterAssignmentCheck. visitMethodParameters(DetailAST ast)
Creates new parameter set for given method.private void
HiddenFieldCheck. visitOtherTokens(DetailAST ast, int type)
Called to process tokens other thanTokenTypes.VARIABLE_DEF
andTokenTypes.PARAMETER_DEF
.private void
IllegalTypeCheck. visitParameterDef(DetailAST parameterDef)
Checks type of parameters.private void
ReturnCountCheck. visitReturn(DetailAST ast)
Examines the return statement and tells context about it.void
AbstractIllegalMethodCheck. visitToken(DetailAST aAST)
Deprecated.void
AbstractSuperCheck. visitToken(DetailAST ast)
void
ArrayTrailingCommaCheck. visitToken(DetailAST arrayInit)
void
AvoidInlineConditionalsCheck. visitToken(DetailAST ast)
void
CovariantEqualsCheck. visitToken(DetailAST ast)
void
DeclarationOrderCheck. visitToken(DetailAST ast)
void
DefaultComesLastCheck. visitToken(DetailAST ast)
void
EmptyStatementCheck. visitToken(DetailAST ast)
void
EqualsAvoidNullCheck. visitToken(DetailAST ast)
void
EqualsHashCodeCheck. visitToken(DetailAST ast)
void
ExplicitInitializationCheck. visitToken(DetailAST ast)
void
FallThroughCheck. visitToken(DetailAST ast)
void
FinalLocalVariableCheck. visitToken(DetailAST ast)
void
HiddenFieldCheck. visitToken(DetailAST ast)
void
IllegalCatchCheck. visitToken(DetailAST detailAST)
void
IllegalInstantiationCheck. visitToken(DetailAST ast)
void
IllegalThrowsCheck. visitToken(DetailAST detailAST)
void
IllegalTokenCheck. visitToken(DetailAST ast)
void
IllegalTokenTextCheck. visitToken(DetailAST ast)
void
IllegalTypeCheck. visitToken(DetailAST ast)
void
InnerAssignmentCheck. visitToken(DetailAST ast)
void
MagicNumberCheck. visitToken(DetailAST ast)
void
MissingCtorCheck. visitToken(DetailAST ast)
void
MissingSwitchDefaultCheck. visitToken(DetailAST ast)
void
ModifiedControlVariableCheck. visitToken(DetailAST ast)
void
MultipleStringLiteralsCheck. visitToken(DetailAST ast)
void
MultipleVariableDeclarationsCheck. visitToken(DetailAST ast)
void
NestedForDepthCheck. visitToken(DetailAST ast)
void
NestedIfDepthCheck. visitToken(DetailAST literalIf)
void
NestedTryDepthCheck. visitToken(DetailAST literalTry)
void
NoCloneCheck. visitToken(DetailAST aAST)
void
NoFinalizerCheck. visitToken(DetailAST aAST)
void
OneStatementPerLineCheck. visitToken(DetailAST ast)
void
OverloadMethodsDeclarationOrderCheck. visitToken(DetailAST ast)
void
PackageDeclarationCheck. visitToken(DetailAST ast)
void
ParameterAssignmentCheck. visitToken(DetailAST ast)
void
RequireThisCheck. visitToken(DetailAST ast)
void
ReturnCountCheck. visitToken(DetailAST ast)
void
SimplifyBooleanExpressionCheck. visitToken(DetailAST ast)
void
SimplifyBooleanReturnCheck. visitToken(DetailAST ast)
void
StringLiteralEqualityCheck. visitToken(DetailAST ast)
void
UnnecessaryParenthesesCheck. visitToken(DetailAST ast)
void
VariableDeclarationUsageDistanceCheck. visitToken(DetailAST ast)
private void
IllegalTypeCheck. visitVariableDef(DetailAST variableDef)
Checks type of given variable.Method parameters in com.puppycrawl.tools.checkstyle.checks.coding with type arguments of type DetailAST Modifier and Type Method Description protected boolean
RequireThisCheck.AbstractFrame. containsFieldOrVariableDef(java.util.Set<DetailAST> set, DetailAST ident)
Whether the set contains a declaration with the text of the specified IDENT ast and it is declared in a proper position.private static boolean
RequireThisCheck.ClassFrame. containsMethodDef(java.util.Set<DetailAST> set, DetailAST ident)
Whether the set contains a method definition with the same name and number of parameters.private void
FinalLocalVariableCheck. updateAllUninitializedVariables(java.util.Deque<DetailAST> prevScopeUnitializedVariableData)
Update current scope data uninitialized variable according to the whole scope data.private void
FinalLocalVariableCheck. updateUninitializedVariables(java.util.Deque<DetailAST> scopeUnitializedVariableData)
Update current scope data uninitialized variable according to the specific scope data.Constructors in com.puppycrawl.tools.checkstyle.checks.coding with parameters of type DetailAST Constructor Description AbstractFrame(RequireThisCheck.AbstractFrame parent, DetailAST ident)
Constructor -- invokable only via super() from subclasses.BlockFrame(RequireThisCheck.AbstractFrame parent, DetailAST ident)
Creates block frame.ClassFrame(RequireThisCheck.AbstractFrame parent, DetailAST ident)
Creates new instance of ClassFrame.ConstructorFrame(RequireThisCheck.AbstractFrame parent, DetailAST ident)
Creates a constructor frame.FinalVariableCandidate(DetailAST variableIdent)
Creates new instance.MethodFrame(RequireThisCheck.AbstractFrame parent, DetailAST ident)
Creates method frame.MethodNode(DetailAST ast)
Constructs a stack node for a method definition. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.design
Fields in com.puppycrawl.tools.checkstyle.checks.design declared as DetailAST Modifier and Type Field Description private DetailAST
HideUtilityClassConstructorCheck.Details. ast
Class ast.Methods in com.puppycrawl.tools.checkstyle.checks.design that return DetailAST Modifier and Type Method Description private DetailAST
VisibilityModifierCheck. findMatchingAnnotation(DetailAST variableDef)
Checks whether the AST is annotated with an annotation containing the passed in regular expression and return the AST representing that annotation.private static DetailAST
VisibilityModifierCheck. getGenericTypeArgs(DetailAST type, boolean isCanonicalName)
Returns generic type arguments token.private static DetailAST
DesignForExtensionCheck. getNearestClassOrEnumDefinition(DetailAST ast)
Returns CLASS_DEF or ENUM_DEF token which is the nearest to the given ast node.private static DetailAST
VisibilityModifierCheck. getNextSubTreeNode(DetailAST currentNodeAst, DetailAST subTreeRootAst)
Gets the next node of a syntactical tree (child of a current node or sibling of a current node, or sibling of a parent of a current node).Methods in com.puppycrawl.tools.checkstyle.checks.design with parameters of type DetailAST Modifier and Type Method Description void
FinalClassCheck. beginTree(DetailAST rootAST)
void
OneTopLevelClassCheck. beginTree(DetailAST rootAST)
void
VisibilityModifierCheck. beginTree(DetailAST rootAst)
private boolean
DesignForExtensionCheck. canBeOverridden(DetailAST methodDef)
Checks whether a method can be overridden.private static boolean
DesignForExtensionCheck. canBeSubclassed(DetailAST classDef)
Checks if the given class (given CLASS_DEF node) can be subclassed.private static java.lang.String
FinalClassCheck. extractQualifiedName(DetailAST classExtend)
Get name of class(with qualified package if specified) in extend clause.private DetailAST
VisibilityModifierCheck. findMatchingAnnotation(DetailAST variableDef)
Checks whether the AST is annotated with an annotation containing the passed in regular expression and return the AST representing that annotation.void
OneTopLevelClassCheck. finishTree(DetailAST rootAST)
private static java.lang.String
DesignForExtensionCheck. getAnnotationName(DetailAST annotation)
Gets the name of the annotation.private static java.lang.String
ThrowsCountCheck. getAnnotationName(DetailAST annotation)
Gets name of an annotation.private static java.lang.String
VisibilityModifierCheck. getCanonicalName(DetailAST type)
Gets canonical type's name from givenTYPE
node.private static DetailAST
VisibilityModifierCheck. getGenericTypeArgs(DetailAST type, boolean isCanonicalName)
Returns generic type arguments token.private static java.util.Set<java.lang.String>
VisibilityModifierCheck. getModifiers(DetailAST defAST)
Returns the set of modifier Strings for a VARIABLE_DEF or CLASS_DEF AST.private static DetailAST
DesignForExtensionCheck. getNearestClassOrEnumDefinition(DetailAST ast)
Returns CLASS_DEF or ENUM_DEF token which is the nearest to the given ast node.private static DetailAST
VisibilityModifierCheck. getNextSubTreeNode(DetailAST currentNodeAst, DetailAST subTreeRootAst)
Gets the next node of a syntactical tree (child of a current node or sibling of a current node, or sibling of a parent of a current node).private java.lang.String
FinalClassCheck. getQualifiedClassName(DetailAST classAst)
Get qualified class name from given class Ast.private static java.lang.String
FinalClassCheck. getSuperClassName(DetailAST classAst)
Get super class name of given class.private static java.util.List<java.lang.String>
VisibilityModifierCheck. getTypeArgsClassNames(DetailAST typeArgs)
Returns a list of type parameters class names.private static java.lang.String
VisibilityModifierCheck. getTypeName(DetailAST type, boolean isCanonicalName)
Gets the name of type from given astTYPE
node.private static java.lang.String
VisibilityModifierCheck. getVisibilityScope(DetailAST variableDef)
Returns the visibility scope for the variable.private static boolean
DesignForExtensionCheck. hasDefaultOrExplicitNonPrivateCtor(DetailAST classDef)
Checks whether a class has default or explicit non-private constructor.private static boolean
DesignForExtensionCheck. hasEmptyImplementation(DetailAST ast)
Checks whether a method has only comments in the body (has an empty implementation).private boolean
VisibilityModifierCheck. hasIgnoreAnnotation(DetailAST variableDef)
Checks if variable def has ignore annotation.private static boolean
DesignForExtensionCheck. hasIgnoredAnnotation(DetailAST methodDef, java.util.Set<java.lang.String> annotations)
Checks whether a method has any of ignored annotations.private boolean
DesignForExtensionCheck. hasJavadocComment(DetailAST methodDef)
Checks whether a method has a javadoc comment.private boolean
VisibilityModifierCheck. hasProperAccessModifier(DetailAST variableDef, java.lang.String variableName)
Checks if current variable has proper access modifier according to Check's options.private static boolean
HideUtilityClassConstructorCheck. isAbstract(DetailAST ast)
Returns true if given class is abstract or false.private boolean
VisibilityModifierCheck. isAllowedPublicField(DetailAST variableDef)
Checks whether the variable satisfies the public field check.private static boolean
VisibilityModifierCheck. isAnonymousClassVariable(DetailAST variableDef)
Checks if current variable definition is definition of an anonymous class.private static boolean
VisibilityModifierCheck. isCanonicalName(DetailAST type)
Checks whether type definition is in canonical form.private boolean
MutableExceptionCheck. isExtendedClassNamedAsException(DetailAST ast)
Checks that if extended class name conforms to specified format.private static boolean
VisibilityModifierCheck. isFinalField(DetailAST variableDef)
Checks whether current field is final.private boolean
VisibilityModifierCheck. isImmutableField(DetailAST variableDef)
Checks if current field is immutable: has final modifier and either a primitive type or instance of class known to be immutable (such as String, ImmutableCollection from Guava and etc).private boolean
VisibilityModifierCheck. isImmutableFieldDefinedInFinalClass(DetailAST variableDef)
Checks whether immutable field is defined in final class.private static boolean
ThrowsCountCheck. isInPrivateMethod(DetailAST ast)
Checks if method, which throws an exception is private.private boolean
MutableExceptionCheck. isNamedAsException(DetailAST ast)
Checks that a class name conforms to specified format.private boolean
DesignForExtensionCheck. isNativeMethod(DetailAST ast)
Checks whether a methods is native.private static boolean
ThrowsCountCheck. isOverriding(DetailAST ast)
Check if a method has annotation @Override.private static boolean
VisibilityModifierCheck. isPrimitive(DetailAST type)
Checks if current type is primitive type (int, short, float, boolean, double, etc.).private static boolean
OneTopLevelClassCheck. isPublic(DetailAST typeDef)
Checks if a type is public.private static boolean
VisibilityModifierCheck. isStarImport(DetailAST importAst)
Checks if current import is star import.private static boolean
HideUtilityClassConstructorCheck. isStatic(DetailAST ast)
Returns true if given class is static or false.private static boolean
VisibilityModifierCheck. isStaticFinalVariable(DetailAST variableDef)
Checks whether variable has static final modifiers.void
FinalClassCheck. leaveToken(DetailAST ast)
void
InnerTypeLastCheck. leaveToken(DetailAST ast)
void
MutableExceptionCheck. leaveToken(DetailAST ast)
private void
FinalClassCheck. registerNestedSubclassToOuterSuperClasses(DetailAST classAst)
Register to outer super classes of given classAst that given classAst is extending them.private void
MutableExceptionCheck. visitClassDef(DetailAST ast)
Called when we start processing class definition.private void
VisibilityModifierCheck. visitImport(DetailAST importAst)
Checks imported type.private void
ThrowsCountCheck. visitLiteralThrows(DetailAST ast)
Checks number of throws statements.void
DesignForExtensionCheck. visitToken(DetailAST ast)
void
FinalClassCheck. visitToken(DetailAST ast)
void
HideUtilityClassConstructorCheck. visitToken(DetailAST ast)
void
InnerTypeLastCheck. visitToken(DetailAST ast)
void
InterfaceIsTypeCheck. visitToken(DetailAST ast)
void
MutableExceptionCheck. visitToken(DetailAST ast)
void
ThrowsCountCheck. visitToken(DetailAST ast)
void
VisibilityModifierCheck. visitToken(DetailAST ast)
private void
MutableExceptionCheck. visitVariableDef(DetailAST ast)
Checks variable definition.private void
VisibilityModifierCheck. visitVariableDef(DetailAST variableDef)
Checks access modifier of given variable.Constructors in com.puppycrawl.tools.checkstyle.checks.design with parameters of type DetailAST Constructor Description Details(DetailAST ast)
C-tor. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.imports
Methods in com.puppycrawl.tools.checkstyle.checks.imports with parameters of type DetailAST Modifier and Type Method Description void
CustomImportOrderCheck. beginTree(DetailAST rootAST)
void
ImportControlCheck. beginTree(DetailAST rootAST)
void
ImportOrderCheck. beginTree(DetailAST rootAST)
void
RedundantImportCheck. beginTree(DetailAST aRootAST)
void
UnusedImportsCheck. beginTree(DetailAST rootAST)
private void
UnusedImportsCheck. collectReferencesFromJavadoc(DetailAST ast)
Collects references made in Javadoc comments.private static java.lang.String
CustomImportOrderCheck. createSamePackageRegexp(int firstPackageDomainsCount, DetailAST packageNode)
Creates samePackageDomainsRegExp of the first package domains.void
CustomImportOrderCheck. finishTree(DetailAST rootAST)
void
UnusedImportsCheck. finishTree(DetailAST rootAST)
private static java.lang.String
CustomImportOrderCheck. getFullImportIdent(DetailAST token)
Forms import full path.private static java.lang.String
ImportControlCheck. getImportText(DetailAST ast)
Returns import text.private static java.lang.String
ImportControlCheck. getPackageText(DetailAST ast)
Returns package text.private void
AvoidStarImportCheck. logsStarredImportViolation(DetailAST startingDot)
Gets the full import identifier.private void
UnusedImportsCheck. processIdent(DetailAST ast)
Collects references made by IDENT.private void
UnusedImportsCheck. processImport(DetailAST ast)
Collects the details of imports.private void
UnusedImportsCheck. processStaticImport(DetailAST ast)
Collects the details of static imports.void
AvoidStarImportCheck. visitToken(DetailAST ast)
void
AvoidStaticImportCheck. visitToken(DetailAST ast)
void
CustomImportOrderCheck. visitToken(DetailAST ast)
void
IllegalImportCheck. visitToken(DetailAST ast)
void
ImportControlCheck. visitToken(DetailAST ast)
void
ImportOrderCheck. visitToken(DetailAST ast)
void
RedundantImportCheck. visitToken(DetailAST ast)
void
UnusedImportsCheck. visitToken(DetailAST ast)
-
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.indentation
Fields in com.puppycrawl.tools.checkstyle.checks.indentation declared as DetailAST Modifier and Type Field Description private DetailAST
AbstractExpressionHandler. mainAst
The AST which is handled by this handler.Fields in com.puppycrawl.tools.checkstyle.checks.indentation with type parameters of type DetailAST Modifier and Type Field Description private java.util.Map<DetailAST,AbstractExpressionHandler>
HandlerFactory. createdHandlers
Cache for created method call handlers.Methods in com.puppycrawl.tools.checkstyle.checks.indentation that return DetailAST Modifier and Type Method Description private DetailAST
CommentsIndentationCheck. findPreviousStatement(DetailAST comment, DetailAST root)
Finds a previous statement of the comment.private static DetailAST
CommentsIndentationCheck. findStartTokenOfMethodCallChain(DetailAST root)
Finds the start token of method call chain.private static DetailAST
CommentsIndentationCheck. findTokenWhichBeginsTheLine(DetailAST root)
Finds a token which begins the line.private static DetailAST
CommentsIndentationCheck. getDistributedPreviousStatement(DetailAST comment)
Returns the first token of the distributed previous statement of comment.private static DetailAST
MethodCallHandler. getFirstAst(DetailAST ast)
Get the first AST of the specified method call.static DetailAST
AbstractExpressionHandler. getFirstToken(DetailAST ast)
Searches in given sub-tree (including given node) for the token which represents first symbol for this sub-tree in file.private static DetailAST
ForHandler. getForLoopRightParen(DetailAST literalForAst)
Returns right parenthesis of for-loop statement.private static DetailAST
IfHandler. getIfStatementRightParen(DetailAST literalIfAst)
Returns right parenthesis of if statement.protected DetailAST
ArrayInitHandler. getLeftCurly()
protected DetailAST
BlockParentHandler. getLeftCurly()
Get the left curly brace portion of the expression we are handling.protected DetailAST
ClassDefHandler. getLeftCurly()
protected DetailAST
ObjectBlockHandler. getLeftCurly()
protected DetailAST
SlistHandler. getLeftCurly()
protected DetailAST
SwitchHandler. getLeftCurly()
protected DetailAST
BlockParentHandler. getLeftParen()
Get the left parenthesis portion of the expression we are handling.protected DetailAST
ArrayInitHandler. getListChild()
protected DetailAST
BlockParentHandler. getListChild()
Get the child element representing the list of statements.protected DetailAST
ClassDefHandler. getListChild()
protected DetailAST
ObjectBlockHandler. getListChild()
protected DetailAST
SlistHandler. getListChild()
protected DetailAST
SwitchHandler. getListChild()
protected DetailAST
AbstractExpressionHandler. getMainAst()
Accessor for the MainAst attribute.private static DetailAST
MethodCallHandler. getMethodCallLastNode(DetailAST firstNode)
Returns method call right paren.private static DetailAST
MethodDefHandler. getMethodDefParamRightParen(DetailAST methodDefAst)
Returns right parenthesis of method definition parameter list.private static DetailAST
LineWrappingHandler. getNextCurNode(DetailAST curNode)
Returns next curNode node.private static DetailAST
CommentsIndentationCheck. getNextStmt(DetailAST comment)
Returns the next statement of a comment.private DetailAST
CommentsIndentationCheck. getNextToken(DetailAST checkedStatement)
Get the token to start counting the number of lines to add to the distance aim from.protected DetailAST
BlockParentHandler. getNonListChild()
Get the child element that is not a list of statements.protected DetailAST
ElseHandler. getNonListChild()
protected DetailAST
SwitchHandler. getNonListChild()
private DetailAST
CommentsIndentationCheck. getOneLinePreviousStatement(DetailAST comment)
Does pre-order traverse of abstract syntax tree to find the previous statement of the comment.private static DetailAST
CommentsIndentationCheck. getPrevCaseToken(DetailAST parentStatement)
Gets previous case-token for comment.private DetailAST
CommentsIndentationCheck. getPreviousStatement(DetailAST comment)
Returns the previous statement of a comment.private static DetailAST
CommentsIndentationCheck. getPrevStatementFromSwitchBlock(DetailAST comment)
Gets comment's previous statement from switch block.private static DetailAST
CommentsIndentationCheck. getPrevStatementWhenCommentIsUnderCase(DetailAST parentStatement)
Gets previous statement for comment which is placed immediately under case.protected DetailAST
ArrayInitHandler. getRightCurly()
protected DetailAST
BlockParentHandler. getRightCurly()
Get the right curly brace portion of the expression we are handling.protected DetailAST
ClassDefHandler. getRightCurly()
protected DetailAST
ObjectBlockHandler. getRightCurly()
protected DetailAST
SlistHandler. getRightCurly()
protected DetailAST
SwitchHandler. getRightCurly()
protected DetailAST
BlockParentHandler. getRightParen()
Get the right parenthesis portion of the expression we are handling.private static DetailAST
SynchronizedHandler. getSynchronizedStatementRightParen(DetailAST syncStatementAST)
Returns right parenthesis of synchronized statement.protected DetailAST
ArrayInitHandler. getTopLevelAst()
protected DetailAST
BlockParentHandler. getTopLevelAst()
Get the top level expression being managed by this handler.protected DetailAST
ClassDefHandler. getTopLevelAst()
protected DetailAST
MethodDefHandler. getTopLevelAst()
protected DetailAST
ObjectBlockHandler. getTopLevelAst()
protected DetailAST
SlistHandler. getTopLevelAst()
private static DetailAST
MemberDefHandler. getVarDefStatementSemicolon(DetailAST variableDef)
Returns semicolon for variable definition statement.Methods in com.puppycrawl.tools.checkstyle.checks.indentation that return types with arguments of type DetailAST Modifier and Type Method Description private java.util.NavigableMap<java.lang.Integer,DetailAST>
LineWrappingHandler. collectFirstNodes(DetailAST firstNode, DetailAST lastNode)
Finds first nodes on line and puts them into Map.Methods in com.puppycrawl.tools.checkstyle.checks.indentation with parameters of type DetailAST Modifier and Type Method Description private static boolean
MethodCallHandler. areMethodsChained(DetailAST ast1, DetailAST ast2)
Checks if ast2 is a chained method call that starts on the same level as ast1 ends.static boolean
AbstractExpressionHandler. areOnSameLine(DetailAST ast1, DetailAST ast2)
Determines if two expressions are on the same line.private boolean
CommentsIndentationCheck. areSameLevelIndented(DetailAST comment, DetailAST prevStmt, DetailAST nextStmt)
Checks if comment and next code statement (or previous code stmt like case in switch block) are indented at the same level, e.g.:void
IndentationCheck. beginTree(DetailAST ast)
private void
LineWrappingHandler. checkAnnotationIndentation(DetailAST atNode, java.util.NavigableMap<java.lang.Integer,DetailAST> firstNodesOnLines, int indentLevel)
Checks line wrapping into annotations.protected void
AbstractExpressionHandler. checkChildren(DetailAST parentNode, int[] tokenTypes, IndentLevel startIndent, boolean firstLineMatches, boolean allowNesting)
Check the indent level of the children of the specified parent expression.protected void
AbstractExpressionHandler. checkExpressionSubtree(DetailAST tree, IndentLevel indentLevel, boolean firstLineMatches, boolean allowNesting)
Check the indentation level for an expression subtree.void
LineWrappingHandler. checkIndentation(DetailAST firstNode, DetailAST lastNode)
Checks line wrapping into expressions and definitions using property 'lineWrappingIndentation'.void
LineWrappingHandler. checkIndentation(DetailAST firstNode, DetailAST lastNode, int indentLevel)
Checks line wrapping into expressions and definitions.void
LineWrappingHandler. checkIndentation(DetailAST firstNode, DetailAST lastNode, int indentLevel, int startIndent, boolean ignoreFirstLine)
Checks line wrapping into expressions and definitions.protected void
AbstractExpressionHandler. checkLeftParen(DetailAST lparen)
Check the indentation of the left parenthesis.protected void
AbstractExpressionHandler. checkRightParen(DetailAST lparen, DetailAST rparen)
Check the indentation of the right parenthesis.protected void
AbstractExpressionHandler. checkWrappingIndentation(DetailAST firstNode, DetailAST lastNode)
Checks indentation on wrapped lines between and includingfirstNode
andlastNode
.protected void
AbstractExpressionHandler. checkWrappingIndentation(DetailAST firstNode, DetailAST lastNode, int wrappedIndentLevel, int startIndent, boolean ignoreFirstLine)
Checks indentation on wrapped lines between and includingfirstNode
andlastNode
.private java.util.NavigableMap<java.lang.Integer,DetailAST>
LineWrappingHandler. collectFirstNodes(DetailAST firstNode, DetailAST lastNode)
Finds first nodes on line and puts them into Map.private int
CommentsIndentationCheck. countEmptyLines(DetailAST startStatement, DetailAST endStatement)
Count the number of empty lines between statements.private AbstractExpressionHandler
HandlerFactory. createMethodCallHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Create new instance of handler for METHOD_CALL.protected int
AbstractExpressionHandler. expandedTabsColumnNo(DetailAST ast)
Get the column number for the start of a given expression, expanding tabs out into spaces in the process.private int
LineWrappingHandler. expandedTabsColumnNo(DetailAST ast)
Get the column number for the start of a given expression, expanding tabs out into spaces in the process.private DetailAST
CommentsIndentationCheck. findPreviousStatement(DetailAST comment, DetailAST root)
Finds a previous statement of the comment.private static DetailAST
CommentsIndentationCheck. findStartTokenOfMethodCallChain(DetailAST root)
Finds the start token of method call chain.protected void
AbstractExpressionHandler. findSubtreeLines(LineSet lines, DetailAST tree, boolean allowNesting)
Find the set of lines for a given subtree.private static DetailAST
CommentsIndentationCheck. findTokenWhichBeginsTheLine(DetailAST root)
Finds a token which begins the line.private static DetailAST
CommentsIndentationCheck. getDistributedPreviousStatement(DetailAST comment)
Returns the first token of the distributed previous statement of comment.private static DetailAST
MethodCallHandler. getFirstAst(DetailAST ast)
Get the first AST of the specified method call.protected int
AbstractExpressionHandler. getFirstLine(int startLine, DetailAST tree)
Get the first line for a given expression.static DetailAST
AbstractExpressionHandler. getFirstToken(DetailAST ast)
Searches in given sub-tree (including given node) for the token which represents first symbol for this sub-tree in file.private static DetailAST
ForHandler. getForLoopRightParen(DetailAST literalForAst)
Returns right parenthesis of for-loop statement.AbstractExpressionHandler
HandlerFactory. getHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Get the handler for an AST.private static java.lang.String
ClassDefHandler. getHandlerName(DetailAST ast)
Creates a handler name for this class according to ast type.private static java.lang.String
MethodDefHandler. getHandlerName(DetailAST ast)
Creates a handler name for this class according to ast type.private static DetailAST
IfHandler. getIfStatementRightParen(DetailAST literalIfAst)
Returns right parenthesis of if statement.protected int
AbstractExpressionHandler. getLineStart(DetailAST ast)
Get the start of the line for the given expression.private int
LineWrappingHandler. getLineStart(DetailAST ast)
Get the start of the line for the given expression.private static java.lang.String
CommentsIndentationCheck. getMessageKey(DetailAST comment)
Get a message key depending on a comment type.private static DetailAST
MethodCallHandler. getMethodCallLastNode(DetailAST firstNode)
Returns method call right paren.private int
MethodDefHandler. getMethodDefLineStart(DetailAST mainAst)
Gets the start line of the method, excluding any annotations.private static DetailAST
MethodDefHandler. getMethodDefParamRightParen(DetailAST methodDefAst)
Returns right parenthesis of method definition parameter list.private static DetailAST
LineWrappingHandler. getNextCurNode(DetailAST curNode)
Returns next curNode node.private static java.lang.Integer
LineWrappingHandler. getNextNodeLine(java.util.NavigableMap<java.lang.Integer,DetailAST> firstNodesOnLines, DetailAST node)
Gets the next node line from the firstNodesOnLines map unless there is no next line, in which case, it returns the last line.private static DetailAST
CommentsIndentationCheck. getNextStmt(DetailAST comment)
Returns the next statement of a comment.private DetailAST
CommentsIndentationCheck. getNextToken(DetailAST checkedStatement)
Get the token to start counting the number of lines to add to the distance aim from.private DetailAST
CommentsIndentationCheck. getOneLinePreviousStatement(DetailAST comment)
Does pre-order traverse of abstract syntax tree to find the previous statement of the comment.private static DetailAST
CommentsIndentationCheck. getPrevCaseToken(DetailAST parentStatement)
Gets previous case-token for comment.private DetailAST
CommentsIndentationCheck. getPreviousStatement(DetailAST comment)
Returns the previous statement of a comment.private static DetailAST
CommentsIndentationCheck. getPrevStatementFromSwitchBlock(DetailAST comment)
Gets comment's previous statement from switch block.private static DetailAST
CommentsIndentationCheck. getPrevStatementWhenCommentIsUnderCase(DetailAST parentStatement)
Gets previous statement for comment which is placed immediately under case.private static DetailAST
SynchronizedHandler. getSynchronizedStatementRightParen(DetailAST syncStatementAST)
Returns right parenthesis of synchronized statement.private static DetailAST
MemberDefHandler. getVarDefStatementSemicolon(DetailAST variableDef)
Returns semicolon for variable definition statement.private void
CommentsIndentationCheck. handleCommentAtTheEndOfTheCodeBlock(DetailAST prevStmt, DetailAST comment, DetailAST nextStmt)
Handles a comment which is placed at the end of non empty code block.private void
CommentsIndentationCheck. handleCommentInEmptyCaseBlock(DetailAST prevStmt, DetailAST comment, DetailAST nextStmt)
Handles a comment which is placed within empty case block.private void
CommentsIndentationCheck. handleCommentInEmptyCodeBlock(DetailAST comment, DetailAST nextStmt)
Handles a comment which is placed within the empty code block.private void
CommentsIndentationCheck. handleFallThroughComment(DetailAST prevStmt, DetailAST comment, DetailAST nextStmt)
Handles 'fall through' single line comment.private static boolean
MemberDefHandler. isArrayDeclaration(DetailAST variableDef)
Checks if variable_def node is array declaration.private static boolean
CommentsIndentationCheck. isBlockStart(DetailAST root)
Whether the AST node starts a block.private static boolean
CommentsIndentationCheck. isComment(DetailAST ast)
Whether the ast is a comment.private static boolean
CommentsIndentationCheck. isCommentAtTheEndOfTheCodeBlock(DetailAST nextStmt)
Checks whether a comment is placed at the end of the code block.private static boolean
CommentsIndentationCheck. isCommentForMultiblock(DetailAST endBlockStmt)
Whether the comment might have been used for the next block in a multi-block structure.private static boolean
CommentsIndentationCheck. isDefinition(DetailAST previousSibling)
Whether the statement is a kind of definition (method, class etc.).private boolean
CommentsIndentationCheck. isDistributedExpression(DetailAST comment)
Checks whether the previous statement of a comment is a method call chain or string concatenation statement distributed over two ore more lines.private boolean
CommentsIndentationCheck. isDistributedPreviousStatement(DetailAST comment)
Checks whether the previous statement of a comment is distributed over two or more lines.private static boolean
CommentsIndentationCheck. isDistributedReturnStatement(DetailAST commentPreviousSibling)
Checks whether the previous statement of a comment is a distributed return statement.private static boolean
CommentsIndentationCheck. isDistributedThrowStatement(DetailAST commentPreviousSibling)
Checks whether the previous statement of a comment is a distributed throw statement.private boolean
LineWrappingHandler. isEndOfScope(DetailAST lastAnnotationNode, DetailAST node)
Checks line for end of scope.private static boolean
CommentsIndentationCheck. isFallThroughComment(DetailAST prevStmt, DetailAST nextStmt)
Checks whether comment is a 'fall through' comment.private static boolean
CommentsIndentationCheck. isInEmptyCaseBlock(DetailAST prevStmt, DetailAST nextStmt)
Checks whether case block is empty.private static boolean
CommentsIndentationCheck. isInEmptyCodeBlock(DetailAST prevStmt, DetailAST nextStmt)
Checks whether comment is placed in the empty code block.private static boolean
SynchronizedHandler. isMethodModifier(DetailAST ast)
Checks if given synchronized is modifier of method.private boolean
CommentsIndentationCheck. isOnPreviousLineIgnoringComments(DetailAST currentStatement, DetailAST checkedStatement)
Checks whether the checked statement is on the previous line ignoring empty lines and lines which contain only comments.protected boolean
AbstractExpressionHandler. isOnStartOfLine(DetailAST ast)
Determines if the given expression is at the start of a line.private static boolean
CommentsIndentationCheck. isStatementWithPossibleCurlies(DetailAST previousSibling)
Whether the statement can have or always have curly brackets.private boolean
CommentsIndentationCheck. isTrailingBlockComment(DetailAST blockComment)
Checks if current comment block is trailing comment, e.g.:private boolean
CommentsIndentationCheck. isTrailingComment(DetailAST comment)
Checks if current comment is a trailing comment.private boolean
CommentsIndentationCheck. isTrailingSingleLineComment(DetailAST singleLineComment)
Checks if current single line comment is trailing comment, e.g.:private static boolean
CommentsIndentationCheck. isUsingOfObjectReferenceToInvokeMethod(DetailAST root)
Checks whether there is a use of an object reference to invoke an object's method on line.void
IndentationCheck. leaveToken(DetailAST ast)
protected void
AbstractExpressionHandler. logError(DetailAST ast, java.lang.String subtypeName, int actualIndent)
Log an indentation error.protected void
AbstractExpressionHandler. logError(DetailAST ast, java.lang.String subtypeName, int actualIndent, IndentLevel expectedIndent)
Log an indentation error.private void
CommentsIndentationCheck. logMultilineIndentation(DetailAST prevStmt, DetailAST comment, DetailAST nextStmt)
Logs comment which can have the same indentation level as next or previous statement.private void
LineWrappingHandler. logWarningMessage(DetailAST currentNode, int currentIndent)
Logs warning message if indentation is incorrect.private void
CommentsIndentationCheck. visitComment(DetailAST comment)
Checks comment indentations over surrounding code, e.g.:void
CommentsIndentationCheck. visitToken(DetailAST commentAst)
void
IndentationCheck. visitToken(DetailAST ast)
Method parameters in com.puppycrawl.tools.checkstyle.checks.indentation with type arguments of type DetailAST Modifier and Type Method Description private void
LineWrappingHandler. checkAnnotationIndentation(DetailAST atNode, java.util.NavigableMap<java.lang.Integer,DetailAST> firstNodesOnLines, int indentLevel)
Checks line wrapping into annotations.private static java.lang.Integer
LineWrappingHandler. getNextNodeLine(java.util.NavigableMap<java.lang.Integer,DetailAST> firstNodesOnLines, DetailAST node)
Gets the next node line from the firstNodesOnLines map unless there is no next line, in which case, it returns the last line.Constructors in com.puppycrawl.tools.checkstyle.checks.indentation with parameters of type DetailAST Constructor Description AbstractExpressionHandler(IndentationCheck indentCheck, java.lang.String typeName, DetailAST expr, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, name, abstract syntax tree, and parent handler.ArrayInitHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.BlockParentHandler(IndentationCheck indentCheck, java.lang.String name, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, name, abstract syntax tree, and parent handler.CaseHandler(IndentationCheck indentCheck, DetailAST expr, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.CatchHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.ClassDefHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.DoWhileHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.ElseHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.FinallyHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.ForHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.IfHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.ImportHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.IndexHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.LabelHandler(IndentationCheck indentCheck, DetailAST expr, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.LambdaHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.MemberDefHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.MethodCallHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.MethodDefHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.NewHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.ObjectBlockHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.PackageDefHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.SlistHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.StaticInitHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.SwitchHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.SynchronizedHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, name, abstract syntax tree, and parent handler.TryHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.WhileHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.javadoc
Fields in com.puppycrawl.tools.checkstyle.checks.javadoc declared as DetailAST Modifier and Type Field Description private DetailAST
AbstractJavadocCheck. blockCommentAst
DetailAST node of considered Javadoc comment that is just a block comment in Java language syntax tree.Methods in com.puppycrawl.tools.checkstyle.checks.javadoc that return DetailAST Modifier and Type Method Description protected DetailAST
AbstractJavadocCheck. getBlockCommentAst()
Getter for block comment in Java language syntax tree.Methods in com.puppycrawl.tools.checkstyle.checks.javadoc that return types with arguments of type DetailAST Modifier and Type Method Description private static java.util.List<DetailAST>
JavadocMethodCheck. getParameters(DetailAST ast)
Computes the parameter nodes for a method.Methods in com.puppycrawl.tools.checkstyle.checks.javadoc with parameters of type DetailAST Modifier and Type Method Description void
AbstractJavadocCheck. beginTree(DetailAST rootAST)
private static Scope
JavadocMethodCheck. calculateScope(DetailAST ast)
Returns the scope for the method/constructor at the specified AST.private void
JavadocMethodCheck. checkComment(DetailAST ast, TextBlock comment)
Checks the Javadoc for a method.private void
JavadocStyleCheck. checkComment(DetailAST ast, TextBlock comment)
Performs the various checks against the Javadoc comment.private void
JavadocStyleCheck. checkFirstSentenceEnding(DetailAST ast, TextBlock comment)
Checks that the first sentence ends with proper punctuation.private void
JavadocStyleCheck. checkHtmlTags(DetailAST ast, TextBlock comment)
Checks the comment for HTML tags that do not have a corresponding close tag or a close tag that has no previous open tag.private void
JavadocMethodCheck. checkParamTags(java.util.List<JavadocTag> tags, DetailAST parent, boolean reportExpectedTags)
Checks a set of tags for matching parameters.void
AbstractJavadocCheck. finishTree(DetailAST rootAST)
private static int
JavadocMethodCheck. getMethodsNumberOfLine(DetailAST methodDef)
Some javadoc.private static java.util.List<DetailAST>
JavadocMethodCheck. getParameters(DetailAST ast)
Computes the parameter nodes for a method.private static int
AtclauseOrderCheck. getParentType(DetailAST commentBlock)
Returns type of parent node.private java.util.List<JavadocMethodCheck.ExceptionInfo>
JavadocMethodCheck. getThrows(DetailAST ast)
Computes the exception nodes for a method.private boolean
JavadocMethodCheck. hasAllowedAnnotations(DetailAST methodDef)
Some javadoc.private boolean
JavadocMethodCheck. hasShortCircuitTag(DetailAST ast, java.util.List<JavadocTag> tags)
Validates whether the Javadoc has a short circuit tag.private boolean
JavadocMethodCheck. isContentsAllowMissingJavadoc(DetailAST ast)
Checks if the Javadoc can be missing if the method or constructor is below the minimum line count or has a special annotation.private boolean
JavadocVariableCheck. isIgnored(DetailAST ast)
Decides whether the variable name of an AST is in the ignore list.protected boolean
JavadocMethodCheck. isMissingJavadocAllowed(DetailAST ast)
The JavadocMethodCheck is about to report a missing Javadoc.private static boolean
SingleLineJavadocCheck. isSingleLineJavadoc(DetailAST blockCommentStart)
Checks if comment is single line comment.abstract boolean
JavadocTagInfo. isValidOn(DetailAST ast)
Checks if a particular Javadoc tag is valid within a Javadoc block of a given AST.private boolean
JavadocMethodCheck. matchesSkipRegex(DetailAST methodDef)
Checks if the given method name matches the regex.protected void
JavadocMethodCheck. processAST(DetailAST ast)
private boolean
JavadocMethodCheck. shouldCheck(DetailAST ast, Scope nodeScope)
Whether we should check this node.private boolean
JavadocStyleCheck. shouldCheck(DetailAST ast)
Whether we should check this node.private boolean
JavadocTypeCheck. shouldCheck(DetailAST ast)
Whether we should check this node.private boolean
JavadocVariableCheck. shouldCheck(DetailAST ast)
Whether we should check this node.void
AbstractJavadocCheck. visitToken(DetailAST blockCommentNode)
void
JavadocStyleCheck. visitToken(DetailAST ast)
void
JavadocTypeCheck. visitToken(DetailAST ast)
void
JavadocVariableCheck. visitToken(DetailAST ast)
void
WriteTagCheck. visitToken(DetailAST ast)
Method parameters in com.puppycrawl.tools.checkstyle.checks.javadoc with type arguments of type DetailAST Modifier and Type Method Description private static boolean
JavadocMethodCheck. removeMatchingParam(java.util.List<DetailAST> params, java.lang.String paramName)
Remove parameter from params collection by name.private static boolean
JavadocMethodCheck. searchMatchingTypeParameter(java.util.List<DetailAST> typeParams, java.lang.String requiredTypeName)
Returns true if required type found in type parameters. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.metrics
Methods in com.puppycrawl.tools.checkstyle.checks.metrics that return DetailAST Modifier and Type Method Description private static DetailAST
NPathComplexityCheck. getLastToken(DetailAST ast)
Finds a leaf, which is the most distant from the root.Methods in com.puppycrawl.tools.checkstyle.checks.metrics with parameters of type DetailAST Modifier and Type Method Description private void
AbstractClassCouplingCheck.ClassContext. addReferencedClassName(DetailAST ast)
Adds new referenced class.void
AbstractClassCouplingCheck. beginTree(DetailAST ast)
void
JavaNCSSCheck. beginTree(DetailAST rootAST)
void
NPathComplexityCheck. beginTree(DetailAST rootAST)
void
BooleanExpressionComplexityCheck.Context. checkCount(DetailAST ast)
Checks if we violates maximum allowed complexity.private static int
NPathComplexityCheck. countCaseTokens(DetailAST ast)
Counts number of case tokens subject to a case group token.private static int
NPathComplexityCheck. countConditionalOperators(DetailAST ast)
Calculates number of conditional operators, including inline ternary operatior, for a token.void
JavaNCSSCheck. finishTree(DetailAST rootAST)
private static DetailAST
NPathComplexityCheck. getLastToken(DetailAST ast)
Finds a leaf, which is the most distant from the root.boolean
NPathComplexityCheck.TokenEnd. isAfter(DetailAST ast)
Checks if saved coordinates located after given token.private static boolean
JavaNCSSCheck. isCountable(DetailAST ast)
Checks if a token is countable for the ncss metric.private static boolean
JavaNCSSCheck. isExpressionCountable(DetailAST ast)
Checks if an expression is countable for the ncss metric.private static boolean
BooleanExpressionComplexityCheck. isPassedInParameter(DetailAST logicalOperator)
Checks if logical operator is part of constructor or method call.private static boolean
BooleanExpressionComplexityCheck. isPipeOperator(DetailAST binaryOr)
Checks ifbinary OR
is applied to exceptions in multi-catch (pipe-syntax).private static boolean
JavaNCSSCheck. isVariableDefCountable(DetailAST ast)
Checks if a variable definition is countable.private void
BooleanExpressionComplexityCheck. leaveExpr(DetailAST ast)
Restores previous context.private void
AbstractComplexityCheck. leaveMethodDef(DetailAST ast)
Deprecated.Process the end of a method definition.private void
CyclomaticComplexityCheck. leaveMethodDef(DetailAST ast)
Process the end of a method definition.private void
NPathComplexityCheck. leaveMethodDef(DetailAST ast)
Process the end of a method definition.void
AbstractClassCouplingCheck. leaveToken(DetailAST ast)
void
AbstractComplexityCheck. leaveToken(DetailAST ast)
Deprecated.void
BooleanExpressionComplexityCheck. leaveToken(DetailAST ast)
void
CyclomaticComplexityCheck. leaveToken(DetailAST ast)
void
JavaNCSSCheck. leaveToken(DetailAST ast)
void
NPathComplexityCheck. leaveToken(DetailAST ast)
protected abstract void
AbstractComplexityCheck. leaveTokenHook(DetailAST ast)
Deprecated.Hook called when leaving a token.void
AbstractClassCouplingCheck.FileContext. registerImport(DetailAST imp)
Registers given import.void
NPathComplexityCheck.TokenEnd. setToken(DetailAST endToken)
Sets end coordinates from given token.private void
AbstractClassCouplingCheck. visitClassDef(DetailAST classDef)
Creates new context for a given class.private void
NPathComplexityCheck. visitConditional(DetailAST ast, int basicBranchingFactor)
Visits if, while, do-while, for and switch tokens - all of them have expression in parentheses which is used for calculation.void
AbstractClassCouplingCheck.ClassContext. visitLiteralNew(DetailAST ast)
Visits NEW.void
AbstractClassCouplingCheck.FileContext. visitLiteralNew(DetailAST ast)
Visits NEW token for the current class context.void
AbstractClassCouplingCheck.ClassContext. visitLiteralThrows(DetailAST literalThrows)
Visits throws clause and collects all exceptions we throw.void
AbstractClassCouplingCheck.FileContext. visitLiteralThrows(DetailAST ast)
Visits THROWS token for the current class context.private void
BooleanExpressionComplexityCheck. visitMethodDef(DetailAST ast)
Creates new context for a given method.private void
AbstractClassCouplingCheck. visitPackageDef(DetailAST pkg)
Stores package of current class we check.void
AbstractClassCouplingCheck. visitToken(DetailAST ast)
void
AbstractComplexityCheck. visitToken(DetailAST ast)
Deprecated.void
BooleanExpressionComplexityCheck. visitToken(DetailAST ast)
void
CyclomaticComplexityCheck. visitToken(DetailAST ast)
void
JavaNCSSCheck. visitToken(DetailAST ast)
void
NPathComplexityCheck. visitToken(DetailAST ast)
protected abstract void
AbstractComplexityCheck. visitTokenHook(DetailAST ast)
Deprecated.Hook called when visiting a token.protected void
CyclomaticComplexityCheck. visitTokenHook(DetailAST ast)
Hook called when visiting a token.void
AbstractClassCouplingCheck.ClassContext. visitType(DetailAST ast)
Visits type.void
AbstractClassCouplingCheck.FileContext. visitType(DetailAST ast)
Visits type token for the current class context.private void
NPathComplexityCheck. visitUnitaryOperator(DetailAST ast, int basicBranchingFactor)
Visits ternary operator (?:) and return tokens. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.modifier
Methods in com.puppycrawl.tools.checkstyle.checks.modifier that return DetailAST Modifier and Type Method Description private static DetailAST
ModifierOrderCheck. checkOrderSuggestedByJls(java.util.List<DetailAST> modifiers)
Checks if the modifiers were added in the order suggested in the Java language specification.private static DetailAST
ModifierOrderCheck. skipAnnotations(java.util.Iterator<DetailAST> modifierIterator)
Skip all annotations in modifier block.Methods in com.puppycrawl.tools.checkstyle.checks.modifier that return types with arguments of type DetailAST Modifier and Type Method Description private static java.util.List<DetailAST>
RedundantModifierCheck. getMethodAnnotationsList(DetailAST methodDef)
Gets the list of annotations on method definition.Methods in com.puppycrawl.tools.checkstyle.checks.modifier with parameters of type DetailAST Modifier and Type Method Description private void
RedundantModifierCheck. checkClassConstructorModifiers(DetailAST classCtorAst)
Check if class constructor has proper modifiers.private void
RedundantModifierCheck. checkEnumConstructorModifiers(DetailAST ast)
Check if enum constructor has proper modifiers.private void
RedundantModifierCheck. checkEnumDef(DetailAST ast)
Checks whether enum has proper modifiers.private void
RedundantModifierCheck. checkForRedundantModifier(DetailAST ast, int modifierType)
Checks if given ast has a redundant modifier.private void
RedundantModifierCheck. checkInterfaceModifiers(DetailAST ast)
Checks if interface has proper modifiers.private static java.util.List<DetailAST>
RedundantModifierCheck. getMethodAnnotationsList(DetailAST methodDef)
Gets the list of annotations on method definition.private static boolean
RedundantModifierCheck. isAnnotatedWithSafeVarargs(DetailAST methodDef)
Checks if method definition is annotated with.private static boolean
ModifierOrderCheck. isAnnotationOnType(DetailAST modifier)
Checks whether annotation on type takes place.private static boolean
RedundantModifierCheck. isClassProtected(DetailAST classDef)
Checks if given class ast has protected modifier.private static boolean
RedundantModifierCheck. isClassPublic(DetailAST ast)
Checks if given class is accessible from "public" scope.private static boolean
RedundantModifierCheck. isEnumMember(DetailAST ast)
Checks if current AST node is member of Enum.private static boolean
RedundantModifierCheck. isInterfaceOrAnnotationMember(DetailAST ast)
Checks if current AST node is member of Interface or Annotation, not of their subnodes.private void
RedundantModifierCheck. processAbstractMethodParameters(DetailAST ast)
Process validation of parameters for Methods with no definition.private void
RedundantModifierCheck. processInterfaceOrAnnotation(DetailAST ast)
Do validation of interface of annotation.private void
RedundantModifierCheck. processMethods(DetailAST ast)
Process validation of Methods.private void
RedundantModifierCheck. processResources(DetailAST ast)
Checks if given resource has redundant modifiers.void
ModifierOrderCheck. visitToken(DetailAST ast)
void
RedundantModifierCheck. visitToken(DetailAST ast)
Method parameters in com.puppycrawl.tools.checkstyle.checks.modifier with type arguments of type DetailAST Modifier and Type Method Description private static DetailAST
ModifierOrderCheck. checkOrderSuggestedByJls(java.util.List<DetailAST> modifiers)
Checks if the modifiers were added in the order suggested in the Java language specification.private static DetailAST
ModifierOrderCheck. skipAnnotations(java.util.Iterator<DetailAST> modifierIterator)
Skip all annotations in modifier block. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.naming
Methods in com.puppycrawl.tools.checkstyle.checks.naming that return types with arguments of type DetailAST Modifier and Type Method Description private static java.util.List<DetailAST>
AbbreviationAsWordInNameCheck. getChildren(DetailAST node)
Gets all the children which are one level below on the current DetailAST parent node.Methods in com.puppycrawl.tools.checkstyle.checks.naming with parameters of type DetailAST Modifier and Type Method Description private static AccessModifier
ParameterNameCheck. getAccessModifier(DetailAST ast)
Returns the access modifier of the method/constructor at the specified AST.private static java.util.List<DetailAST>
AbbreviationAsWordInNameCheck. getChildren(DetailAST node)
Gets all the children which are one level below on the current DetailAST parent node.private static boolean
AbbreviationAsWordInNameCheck. hasOverrideAnnotation(DetailAST methodModifiersAST)
Checks that the method has "@Override" annotation.private static boolean
AbstractClassNameCheck. isAbstract(DetailAST ast)
Checks if declared class is abstract or not.private static boolean
LocalVariableNameCheck. isForLoopVariable(DetailAST variableDef)
Checks if a variable is the loop's one.private boolean
AbbreviationAsWordInNameCheck. isIgnoreSituation(DetailAST ast)
Checks if it is an ignore situation.private static boolean
AbbreviationAsWordInNameCheck. isInterfaceDeclaration(DetailAST variableDefAst)
Check that variable definition in interface or @interface definition.private static boolean
ParameterNameCheck. isOverriddenMethod(DetailAST ast)
Checks whether a method is annotated with Override annotation.protected boolean
AbstractAccessControlNameCheck. mustCheckName(DetailAST ast)
protected abstract boolean
AbstractNameCheck. mustCheckName(DetailAST ast)
Decides whether the name of an AST should be checked against the format regexp.protected boolean
AbstractTypeParameterNameCheck. mustCheckName(DetailAST ast)
Deprecated.protected boolean
CatchParameterNameCheck. mustCheckName(DetailAST ast)
protected boolean
ClassTypeParameterNameCheck. mustCheckName(DetailAST ast)
protected boolean
ConstantNameCheck. mustCheckName(DetailAST ast)
protected boolean
InterfaceTypeParameterNameCheck. mustCheckName(DetailAST ast)
protected boolean
LocalFinalVariableNameCheck. mustCheckName(DetailAST ast)
protected boolean
LocalVariableNameCheck. mustCheckName(DetailAST ast)
protected boolean
MemberNameCheck. mustCheckName(DetailAST ast)
protected boolean
MethodTypeParameterNameCheck. mustCheckName(DetailAST ast)
protected boolean
ParameterNameCheck. mustCheckName(DetailAST ast)
protected boolean
StaticVariableNameCheck. mustCheckName(DetailAST ast)
protected boolean
AbstractAccessControlNameCheck. shouldCheckInScope(DetailAST modifiers)
Should we check member with given modifiers.private void
AbstractClassNameCheck. visitClassDef(DetailAST ast)
Checks class definition.void
AbbreviationAsWordInNameCheck. visitToken(DetailAST ast)
void
AbstractClassNameCheck. visitToken(DetailAST ast)
void
AbstractNameCheck. visitToken(DetailAST ast)
void
MethodNameCheck. visitToken(DetailAST ast)
void
PackageNameCheck. visitToken(DetailAST ast)
-
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.regexp
Methods in com.puppycrawl.tools.checkstyle.checks.regexp with parameters of type DetailAST Modifier and Type Method Description void
RegexpCheck. beginTree(DetailAST rootAST)
void
RegexpSinglelineJavaCheck. beginTree(DetailAST rootAST)
-
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.sizes
Fields in com.puppycrawl.tools.checkstyle.checks.sizes declared as DetailAST Modifier and Type Field Description private DetailAST
ExecutableStatementCountCheck.Context. ast
Member AST node.Methods in com.puppycrawl.tools.checkstyle.checks.sizes that return DetailAST Modifier and Type Method Description DetailAST
ExecutableStatementCountCheck.Context. getAST()
Gets the member AST node.Methods in com.puppycrawl.tools.checkstyle.checks.sizes with parameters of type DetailAST Modifier and Type Method Description void
ExecutableStatementCountCheck. beginTree(DetailAST rootAST)
void
LineLengthCheck. beginTree(DetailAST rootAST)
void
OuterTypeNumberCheck. beginTree(DetailAST ast)
private void
MethodCountCheck. checkCounters(MethodCountCheck.MethodCounter counter, DetailAST ast)
Check the counters and report violations.private void
MethodCountCheck. checkMax(int max, int value, java.lang.String msg, DetailAST ast)
Utility for reporting if a maximum has been exceeded.void
OuterTypeNumberCheck. finishTree(DetailAST ast)
private int
MethodLengthCheck. getLengthOfBlock(DetailAST openingBrace, DetailAST closingBrace)
Returns length of code only without comments and blank lines.private void
ExecutableStatementCountCheck. leaveMemberDef(DetailAST ast)
Process the end of a member definition.void
ExecutableStatementCountCheck. leaveToken(DetailAST ast)
void
MethodCountCheck. leaveToken(DetailAST ast)
void
OuterTypeNumberCheck. leaveToken(DetailAST ast)
private void
MethodCountCheck. raiseCounter(DetailAST method)
Determine the visibility modifier and raise the corresponding counter.private boolean
ParameterNumberCheck. shouldIgnoreNumberOfParameters(DetailAST ast)
Determine whether to ignore number of parameters for the method.private void
ExecutableStatementCountCheck. visitMemberDef(DetailAST ast)
Process the start of the member definition.private void
ExecutableStatementCountCheck. visitSlist(DetailAST ast)
Process the end of a statement list.void
AnonInnerLengthCheck. visitToken(DetailAST ast)
void
ExecutableStatementCountCheck. visitToken(DetailAST ast)
void
MethodCountCheck. visitToken(DetailAST ast)
void
MethodLengthCheck. visitToken(DetailAST ast)
void
OuterTypeNumberCheck. visitToken(DetailAST ast)
void
ParameterNumberCheck. visitToken(DetailAST ast)
Constructors in com.puppycrawl.tools.checkstyle.checks.sizes with parameters of type DetailAST Constructor Description Context(DetailAST ast)
Creates new member context. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.whitespace
Methods in com.puppycrawl.tools.checkstyle.checks.whitespace that return DetailAST Modifier and Type Method Description private static DetailAST
NoWhitespaceAfterCheck. getArrayDeclaratorPreviousElement(DetailAST ast)
Returns proper argument for getPositionAfter method, it is a token afterARRAY_DECLARATOR
, in can beRBRACK
,IDENT
or an array type definition (literal).private static DetailAST
NoWhitespaceAfterCheck. getFirstNonArrayDeclaratorParent(DetailAST ast)
Get node that ownsARRAY_DECLARATOR
sequence.private static DetailAST
NoWhitespaceAfterCheck. getIdentLastToken(DetailAST ast)
Gets leftmost token of identifier.private static DetailAST
NoWhitespaceAfterCheck. getIndexOpPreviousElement(DetailAST ast)
Gets previous node forINDEX_OP
token for usage in getPositionAfter method, it is a simplified copy of getArrayDeclaratorPreviousElement method.private static DetailAST
NoWhitespaceAfterCheck. getPreviousNodeWithParentOfTypeAst(DetailAST ast, DetailAST parent)
Finds previous node by text order for an array declarator, which parent type isTYPE
.private static DetailAST
NoWhitespaceAfterCheck. getTypeLastNode(DetailAST ast)
Searches parameter node for a type node.private static DetailAST
NoWhitespaceAfterCheck. getWhitespaceFollowedNode(DetailAST ast)
For a visited ast node returns node that should be checked for not being followed by whitespace.Methods in com.puppycrawl.tools.checkstyle.checks.whitespace with parameters of type DetailAST Modifier and Type Method Description void
GenericWhitespaceCheck. beginTree(DetailAST rootAST)
void
SingleSpaceSeparatorCheck. beginTree(DetailAST rootAST)
private static DetailAST
NoWhitespaceAfterCheck. getArrayDeclaratorPreviousElement(DetailAST ast)
Returns proper argument for getPositionAfter method, it is a token afterARRAY_DECLARATOR
, in can beRBRACK
,IDENT
or an array type definition (literal).private java.util.List<java.lang.Integer>
EmptyLineSeparatorCheck. getEmptyLines(DetailAST ast)
Get list of empty lines.private static DetailAST
NoWhitespaceAfterCheck. getFirstNonArrayDeclaratorParent(DetailAST ast)
Get node that ownsARRAY_DECLARATOR
sequence.private static DetailAST
NoWhitespaceAfterCheck. getIdentLastToken(DetailAST ast)
Gets leftmost token of identifier.private static DetailAST
NoWhitespaceAfterCheck. getIndexOpPreviousElement(DetailAST ast)
Gets previous node forINDEX_OP
token for usage in getPositionAfter method, it is a simplified copy of getArrayDeclaratorPreviousElement method.private static int
NoWhitespaceAfterCheck. getPositionAfter(DetailAST ast)
Gets position after token (place of possible redundant whitespace).private static DetailAST
NoWhitespaceAfterCheck. getPreviousNodeWithParentOfTypeAst(DetailAST ast, DetailAST parent)
Finds previous node by text order for an array declarator, which parent type isTYPE
.private static DetailAST
NoWhitespaceAfterCheck. getTypeLastNode(DetailAST ast)
Searches parameter node for a type node.private static DetailAST
NoWhitespaceAfterCheck. getWhitespaceFollowedNode(DetailAST ast)
For a visited ast node returns node that should be checked for not being followed by whitespace.private boolean
EmptyLineSeparatorCheck. hasEmptyLineAfter(DetailAST token)
Checks if token have empty line after.private boolean
EmptyLineSeparatorCheck. hasEmptyLineBefore(DetailAST token)
Checks if a token has a empty line before.private boolean
EmptyLineSeparatorCheck. hasMultipleLinesBefore(DetailAST ast)
Whether the token has not allowed multiple empty lines before.private boolean
EmptyLineSeparatorCheck. hasNotAllowedTwoEmptyLinesBefore(DetailAST token)
Checks if a token has empty two previous lines and multiple empty lines is not allowed.private boolean
NoWhitespaceAfterCheck. hasTrailingWhitespace(DetailAST ast, int whitespaceColumnNo, int whitespaceLineNo)
Checks if there is unwanted whitespace after the visited node.private boolean
ParenPadCheck. isAcceptableToken(DetailAST ast)
Checks whether AcceptableTokens contains the given ast.private static boolean
GenericWhitespaceCheck. isAfterMethodReference(DetailAST genericEnd)
Checks if current generic end ('>') is located aftermethod reference operator
.private static boolean
EmptyLineSeparatorCheck. isComment(DetailAST ast)
Check if token is a comment.private boolean
WhitespaceAroundCheck. isEmptyBlock(DetailAST ast, int parentType)
Is empty block.private static boolean
WhitespaceAroundCheck. isEmptyBlock(DetailAST ast, int parentType, int match)
Tests if a givenDetailAST
is part of an empty block.private boolean
WhitespaceAroundCheck. isEmptyCatch(DetailAST ast, int parentType)
Tests if the givenDetailAst
is part of an allowed empty catch block.private boolean
WhitespaceAroundCheck. isEmptyCtorBlock(DetailAST ast, int parentType)
Test if the givenDetailAST
is part of an allowed empty constructor (ctor) block.private boolean
WhitespaceAroundCheck. isEmptyLambda(DetailAST ast, int parentType)
Test if the givenDetailAST
is part of an allowed empty lambda block.private boolean
WhitespaceAroundCheck. isEmptyLoop(DetailAST ast, int parentType)
Checks if loop is empty.private boolean
WhitespaceAroundCheck. isEmptyMethodBlock(DetailAST ast, int parentType)
Test if the givenDetailAST
is part of an allowed empty method block.private static boolean
WhitespaceAroundCheck. isEmptyType(DetailAST ast)
Test if the givenDetailAST
is part of an empty block.private static boolean
WhitespaceAfterCheck. isFollowedByWhitespace(DetailAST targetAST, java.lang.String line)
Checks whether token is followed by a whitespace.private static boolean
ParenPadCheck. isFollowsEmptyForIterator(DetailAST ast)
Checks that a token follows an empty for iterator.private static boolean
GenericWhitespaceCheck. isGenericBeforeMethod(DetailAST ast)
Is generic before method reference.private static boolean
NoWhitespaceBeforeCheck. isInEmptyForInitializer(DetailAST semicolonAst)
Checks that semicolon is in empty for initializer.private static boolean
ParenPadCheck. isInTypecast(DetailAST ast)
Checks whetherTokenTypes.RPAREN
is a closing paren of aTokenTypes.TYPECAST
.private boolean
WhitespaceAroundCheck. isNotRelevantSituation(DetailAST ast, int currentType)
Is ast not a target of Check.private static boolean
WhitespaceAroundCheck. isPartOfDoubleBraceInitializerForNextToken(DetailAST ast)
Check if given ast is part of double brace initializer and if it should omit checking if next token is separated by whitespace.private static boolean
WhitespaceAroundCheck. isPartOfDoubleBraceInitializerForPreviousToken(DetailAST ast)
Check if given ast is part of double brace initializer and if it should omit checking if previous token is separated by whitespace.private static boolean
EmptyLineSeparatorCheck. isPrecededByJavadoc(DetailAST token)
Check if token is preceded by javadoc comment.private static boolean
ParenPadCheck. isPrecedingEmptyForInit(DetailAST ast)
Checks that a token precedes an empty for initializer.private boolean
EmptyLineSeparatorCheck. isPrePreviousLineEmpty(DetailAST token)
Checks if a token has empty pre-previous line.private static boolean
EmptyLineSeparatorCheck. isTypeField(DetailAST variableDef)
If variable definition is a type field.private boolean
EmptyLineSeparatorCheck. isViolatingEmptyLineBetweenFieldsPolicy(DetailAST detailAST)
Checks whether token placement violates policy of empty line between fields.private void
GenericWhitespaceCheck. processEnd(DetailAST ast)
Checks the token for the end of Generics.private void
ParenPadCheck. processExpression(DetailAST ast)
private void
EmptyLineSeparatorCheck. processImport(DetailAST ast, DetailAST nextToken, int astType)
Process Import.protected void
AbstractParenPadCheck. processLeft(DetailAST ast)
Process a token representing a left parentheses.private void
EmptyLineSeparatorCheck. processMultipleLinesInside(DetailAST ast)
Log violation in case there are multiple empty lines inside constructor, initialization block or method.private void
GenericWhitespaceCheck. processNestedGenerics(DetailAST ast, java.lang.String line, int after)
Process Nested generics.private void
EmptyLineSeparatorCheck. processPackage(DetailAST ast, DetailAST nextToken)
Process Package.protected void
AbstractParenPadCheck. processRight(DetailAST ast)
Process a token representing a right parentheses.private void
GenericWhitespaceCheck. processSingleGeneric(DetailAST ast, java.lang.String line, int after)
Process Single-generic.private void
GenericWhitespaceCheck. processStart(DetailAST ast)
Checks the token for the start of Generics.private void
EmptyLineSeparatorCheck. processVariableDef(DetailAST ast, DetailAST nextToken)
Process Variable.private static boolean
WhitespaceAroundCheck. shouldCheckSeparationFromNextToken(DetailAST ast, char nextChar)
Check if it should be checked if next token is separated from current by whitespace.private static boolean
WhitespaceAroundCheck. shouldCheckSeparationFromPreviousToken(DetailAST ast)
Check if it should be checked if previous token is separated from current by whitespace.private void
SingleSpaceSeparatorCheck. visitEachToken(DetailAST node)
Examines every sibling and child ofnode
for violations.private void
ParenPadCheck. visitLiteralFor(DetailAST ast)
Checks parens inTokenTypes.LITERAL_FOR
.void
EmptyForInitializerPadCheck. visitToken(DetailAST ast)
void
EmptyForIteratorPadCheck. visitToken(DetailAST ast)
void
EmptyLineSeparatorCheck. visitToken(DetailAST ast)
void
GenericWhitespaceCheck. visitToken(DetailAST ast)
void
MethodParamPadCheck. visitToken(DetailAST ast)
void
NoLineWrapCheck. visitToken(DetailAST ast)
void
NoWhitespaceAfterCheck. visitToken(DetailAST ast)
void
NoWhitespaceBeforeCheck. visitToken(DetailAST ast)
void
OperatorWrapCheck. visitToken(DetailAST ast)
void
ParenPadCheck. visitToken(DetailAST ast)
void
SeparatorWrapCheck. visitToken(DetailAST ast)
void
TypecastParenPadCheck. visitToken(DetailAST ast)
void
WhitespaceAfterCheck. visitToken(DetailAST ast)
void
WhitespaceAroundCheck. visitToken(DetailAST ast)
private void
ParenPadCheck. visitTokenWithOptionalParentheses(DetailAST ast)
Checks parens in token which may not contain parens, e.g. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.grammars
Fields in com.puppycrawl.tools.checkstyle.grammars declared as DetailAST Modifier and Type Field Description private DetailAST
GeneratedJavaRecognizer. currentGtSequence
The most recently seen gt sequence (GT, SR or BSR) encountered in any type argument or type parameter production.Methods in com.puppycrawl.tools.checkstyle.grammars that return DetailAST Modifier and Type Method Description private DetailAST
GeneratedJavaRecognizer. emitSingleGt()
Emits a single GT AST node with the line and column correctly set to its position in the source file.Methods in com.puppycrawl.tools.checkstyle.grammars with parameters of type DetailAST Modifier and Type Method Description private void
GeneratedJavaRecognizer. consumeCurrentGtSequence(DetailAST gtSequence)
Consume a sequence of '>' characters (GT, SR or BSR) and match these against the '<' characters seen. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.gui
Fields in com.puppycrawl.tools.checkstyle.gui with type parameters of type DetailAST Modifier and Type Field Description private java.util.Map<DetailAST,DetailNode>
ParseTreeTablePresentation. blockCommentToJavadocTree
Cache to store already parsed Javadoc comments.Methods in com.puppycrawl.tools.checkstyle.gui that return DetailAST Modifier and Type Method Description private static DetailAST
ParseTreeTablePresentation. createArtificialTreeRoot()
Creates artificial tree root.DetailAST
MainFrameModel. parseFile(java.io.File file)
Parse a file and return the parse tree.DetailAST
MainFrameModel. parseFileWithComments(java.io.File file)
Parse a file and return the parse tree with comment nodes.Methods in com.puppycrawl.tools.checkstyle.gui with parameters of type DetailAST Modifier and Type Method Description private int
CodeSelectorPresentation. findLastPosition(DetailAST astNode)
Finds the last position of node without children.private void
CodeSelectorPresentation. findSelectionPositions(DetailAST ast)
Find start and end selection positions from AST line and Column.private java.lang.Object
ParseTreeTablePresentation. getChildAtDetailAst(DetailAST parent, int index)
Gets child of DetailAST node at specified index.private DetailNode
ParseTreeTablePresentation. getJavadocTree(DetailAST blockComment)
Gets Javadoc (DetailNode) tree of specified block comments.private java.lang.Object
ParseTreeTablePresentation. getValueAtDetailAST(DetailAST ast, int column)
Gets a value for DetailAST object.protected void
ParseTreeTableModel. setParseTree(DetailAST parseTree)
Sets parse tree.protected void
ParseTreeTablePresentation. setParseTree(DetailAST parseTree)
Set parse tree.Constructors in com.puppycrawl.tools.checkstyle.gui with parameters of type DetailAST Constructor Description CodeSelectorPresentation(DetailAST ast, java.util.List<java.lang.Integer> lines2position)
Constructor.ParseTreeTableModel(DetailAST parseTree)
Initialise pModel.ParseTreeTablePresentation(DetailAST parseTree)
Constructor initialise root node. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.utils
Methods in com.puppycrawl.tools.checkstyle.utils that return DetailAST Modifier and Type Method Description static DetailAST
AnnotationUtility. getAnnotation(DetailAST ast, java.lang.String annotation)
Checks to see if the AST is annotated with the passed in annotation and return the AST representing that annotation.static DetailAST
AnnotationUtility. getAnnotationHolder(DetailAST ast)
Gets the AST that holds a series of annotations for the potentially annotated AST.static DetailAST
CheckUtils. getFirstNode(DetailAST node)
Finds sub-node for given node minimal (line, column) pair.private static DetailAST
BlockCommentPosition. getNextSiblingSkipComments(DetailAST node)
Get next sibling node skipping any comment nodes.private static DetailAST
BlockCommentPosition. getPrevSiblingSkipComments(DetailAST node)
Get previous sibling node skipping any comments.Methods in com.puppycrawl.tools.checkstyle.utils that return types with arguments of type DetailAST Modifier and Type Method Description static java.util.Optional<DetailAST>
TokenUtils. findFirstTokenByPredicate(DetailAST root, java.util.function.Predicate<DetailAST> predicate)
Finds the firstOptional
child token ofDetailAST
root node which matches the given predicate.static java.util.List<DetailAST>
CheckUtils. getTypeParameters(DetailAST node)
Retrieves the type parameters to the node.Methods in com.puppycrawl.tools.checkstyle.utils with parameters of type DetailAST Modifier and Type Method Description static boolean
AnnotationUtility. containsAnnotation(DetailAST ast)
Checks to see if the AST is annotated with any annotation.static boolean
AnnotationUtility. containsAnnotation(DetailAST ast, java.lang.String annotation)
Checks to see if the AST is annotated with the passed in annotation.static FullIdent
CheckUtils. createFullType(DetailAST typeAST)
CreatesFullIdent
for given type node.private static FullIdent
CheckUtils. createFullTypeNoArrays(DetailAST typeAST)
Returns FullIndent for given type.static java.util.Optional<DetailAST>
TokenUtils. findFirstTokenByPredicate(DetailAST root, java.util.function.Predicate<DetailAST> predicate)
Finds the firstOptional
child token ofDetailAST
root node which matches the given predicate.static AccessModifier
CheckUtils. getAccessModifierFromModifiersToken(DetailAST modifiersToken)
ReturnsAccessModifier
based on the information about access modifier taken from the given token of typeTokenTypes.MODIFIERS
.static DetailAST
AnnotationUtility. getAnnotation(DetailAST ast, java.lang.String annotation)
Checks to see if the AST is annotated with the passed in annotation and return the AST representing that annotation.static DetailAST
AnnotationUtility. getAnnotationHolder(DetailAST ast)
Gets the AST that holds a series of annotations for the potentially annotated AST.private static java.lang.String
JavadocUtils. getBlockCommentContent(DetailAST blockCommentBegin)
Gets content of block comment.static DetailAST
CheckUtils. getFirstNode(DetailAST node)
Finds sub-node for given node minimal (line, column) pair.static java.lang.String
JavadocUtils. getJavadocCommentContent(DetailAST javadocCommentBegin)
Get content of Javadoc comment.private static DetailAST
BlockCommentPosition. getNextSiblingSkipComments(DetailAST node)
Get next sibling node skipping any comment nodes.private static DetailAST
BlockCommentPosition. getPrevSiblingSkipComments(DetailAST node)
Get previous sibling node skipping any comments.static Scope
ScopeUtils. getScopeFromMods(DetailAST aMods)
Returns the Scope specified by the modifier set.static Scope
ScopeUtils. getSurroundingScope(DetailAST node)
Returns the scope of the surrounding "block".static java.util.List<java.lang.String>
CheckUtils. getTypeParameterNames(DetailAST node)
Retrieves the names of the type parameters to the node.static java.util.List<DetailAST>
CheckUtils. getTypeParameters(DetailAST node)
Retrieves the type parameters to the node.static boolean
ScopeUtils. isClassFieldDef(DetailAST node)
Determines whether a node is a class field definition.static boolean
JavadocUtils. isCorrectJavadocPosition(DetailAST blockComment)
Checks Javadoc comment it's in right place.private static boolean
CheckUtils. isElse(DetailAST ast)
Returns whether a token represents an ELSE.static boolean
CheckUtils. isElseIf(DetailAST ast)
Returns whether a token represents an ELSE as part of an ELSE / IF set.private static boolean
CheckUtils. isElseWithCurlyBraces(DetailAST ast)
Returns whether a token represents an SLIST as part of an ELSE statement.static boolean
CheckUtils. isEqualsMethod(DetailAST ast)
Tests whether a method definition AST defines an equals covariant.static boolean
CheckUtils. isGetterMethod(DetailAST ast)
Returns whether an AST represents a getter method.static boolean
ScopeUtils. isInAnnotationBlock(DetailAST node)
Returns whether a node is directly contained within an annotation block.static boolean
ScopeUtils. isInCodeBlock(DetailAST node)
Returns whether the scope of a node is restricted to a code block.static boolean
ScopeUtils. isInEnumBlock(DetailAST node)
Returns whether a node is directly contained within an enum block.static boolean
ScopeUtils. isInInterfaceBlock(DetailAST node)
Returns whether a node is directly contained within an interface block.static boolean
ScopeUtils. isInInterfaceOrAnnotationBlock(DetailAST node)
Returns whether a node is directly contained within an interface or annotation block.static boolean
ScopeUtils. isInScope(DetailAST ast, Scope scope)
Checks whether ast node is in a specific scope.static boolean
JavadocUtils. isJavadocComment(DetailAST blockCommentBegin)
Checks block comment content starts with '*' javadoc comment identifier.static boolean
ScopeUtils. isLocalVariableDef(DetailAST node)
Determines whether a node is a local variable definition.static boolean
CheckUtils. isNonVoidMethod(DetailAST methodDefAst)
Checks whether a method is a not void one.static boolean
BlockCommentPosition. isOnAnnotationDef(DetailAST blockComment)
Node is on annotation definition.static boolean
BlockCommentPosition. isOnClass(DetailAST blockComment)
Node is on class definition.static boolean
BlockCommentPosition. isOnConstructor(DetailAST blockComment)
Node is on constructor.static boolean
BlockCommentPosition. isOnEnum(DetailAST blockComment)
Node is on enum definition.static boolean
BlockCommentPosition. isOnEnumConstant(DetailAST blockComment)
Node is on enum constant.static boolean
BlockCommentPosition. isOnField(DetailAST blockComment)
Node is on field declaration.static boolean
BlockCommentPosition. isOnInterface(DetailAST blockComment)
Node is on interface definition.static boolean
BlockCommentPosition. isOnMethod(DetailAST blockComment)
Node is on method declaration.private static boolean
BlockCommentPosition. isOnPlainClassMember(DetailAST blockComment, int memberType)
Checks that block comment is on specified class member without any modifiers.private static boolean
BlockCommentPosition. isOnPlainToken(DetailAST blockComment, int parentTokenType, int nextTokenType)
Checks that block comment is on specified token without any modifiers.private static boolean
BlockCommentPosition. isOnTokenWithAnnotation(DetailAST blockComment, int tokenType)
Checks that block comment is on specified token with annotation.private static boolean
BlockCommentPosition. isOnTokenWithModifiers(DetailAST blockComment, int tokenType)
Checks that block comment is on specified token with modifiers.static boolean
ScopeUtils. isOuterMostType(DetailAST node)
Returns whether a node is contained in the outer most type block.static boolean
CheckUtils. isReceiverParameter(DetailAST parameterDefAst)
Checks whether a parameter is a receiver.static boolean
CheckUtils. isSetterMethod(DetailAST ast)
Returns whether an AST represents a setter method.Method parameters in com.puppycrawl.tools.checkstyle.utils with type arguments of type DetailAST Modifier and Type Method Description static java.util.Optional<DetailAST>
TokenUtils. findFirstTokenByPredicate(DetailAST root, java.util.function.Predicate<DetailAST> predicate)
Finds the firstOptional
child token ofDetailAST
root node which matches the given predicate.
-