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 DetailASTTreeWalker. appendHiddenCommentNodes(DetailAST root)Appends comment nodes to existing AST.private static DetailASTTreeWalker. createBlockCommentNode(antlr.Token token)Create block comment from token.private static DetailASTTreeWalker. createCommentAstFromToken(antlr.Token token)Create comment AST from token.private static DetailASTDetailNodeTreeStringPrinter. createFakeBlockComment(java.lang.String content)Creates DetailAST block comment to pass it to the Javadoc parser.private static DetailASTTreeWalker. createSlCommentNode(antlr.Token token)Create single-line comment from token.static DetailASTTreeWalker. parse(FileContents contents)Static helper method to parses a Java source file.private static DetailASTAstTreeStringPrinter. parseFile(java.io.File file, boolean withComments)Parse a file and return the parse tree.private static DetailASTAstTreeStringPrinter. parseFileText(FileText text, boolean withComments)Parse a text and return the parse tree.static DetailASTTreeWalker. 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 DetailASTTreeWalker. appendHiddenCommentNodes(DetailAST root)Appends comment nodes to existing AST.private static java.lang.StringAstTreeStringPrinter. 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.StringAstTreeStringPrinter. getNodeInfo(DetailAST node)Get string representation of the node as token name, node text, line number and column number.private static booleanTreeWalker. isPositionGreater(DetailAST ast1, DetailAST ast2)Checks if position of first DetailAST is greater than position of second DetailAST.private voidTreeWalker. notifyBegin(DetailAST rootAST, FileContents contents, TreeWalker.AstState astState)Notify checks that we are about to begin walking a tree.private voidTreeWalker. notifyEnd(DetailAST rootAST, TreeWalker.AstState astState)Notify checks that we have finished walking a tree.private voidTreeWalker. notifyLeave(DetailAST ast, TreeWalker.AstState astState)Notify checks that leaving a node.private voidTreeWalker. notifyVisit(DetailAST ast, TreeWalker.AstState astState)Notify checks that visiting a node.private static java.lang.StringAstTreeStringPrinter. parseAndPrintJavadocTree(DetailAST node)Parses block comment as javadoc and prints its tree.static DetailNodeDetailNodeTreeStringPrinter. parseJavadocAsDetailNode(DetailAST blockComment)Parse block comment DetailAST as Javadoc DetailNode tree.JavadocDetailNodeParser.ParseStatusJavadocDetailNodeParser. parseJavadocAsDetailNode(DetailAST javadocCommentAst)Parses Javadoc comment as DetailNode tree.private static java.lang.StringAstTreeStringPrinter. printJavaAndJavadocTree(DetailAST ast)Prints full tree (java + comments + javadoc) of the DetailAST.private static java.lang.StringAstTreeStringPrinter. printTree(DetailAST ast)Print AST.private voidTreeWalker. processIter(DetailAST root, TreeWalker.AstState astState)Processes a node calling interested checks at each node.private voidTreeWalker. 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 DetailASTDetailAST. parentThe parent token.private DetailASTDetailAST. previousSiblingPrevious sibling.Methods in com.puppycrawl.tools.checkstyle.api that return DetailAST Modifier and Type Method Description DetailASTDetailAST. findFirstToken(int type)Returns the first child token that makes a specified type.DetailASTDetailAST. getFirstChild()DetailASTDetailAST. getLastChild()Gets the last child node.DetailASTDetailAST. getNextSibling()DetailASTDetailAST. getParent()Returns the parent token.DetailASTDetailAST. 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 voidDetailAST. addNextSibling(DetailAST ast)Add next sibling.voidDetailAST. addPreviousSibling(DetailAST ast)Add previous sibling.private voidFullIdent. append(DetailAST ast)Append the specified token and also recalibrate the first line and column.voidAbstractCheck. beginTree(DetailAST rootAST)Called before the starting to process a tree.private static voidDetailAST. clearChildCountCache(DetailAST ast)Clears the child count for the ast instance.static FullIdentFullIdent. createFullIdent(DetailAST ast)Creates a new FullIdent starting from the specified node.static FullIdentFullIdent. createFullIdentBelow(DetailAST ast)Creates a new FullIdent starting from the child of the specified node.private static voidFullIdent. extractFullIdent(FullIdent full, DetailAST ast)Recursively extract a FullIdent.private static intDetailAST. findColumnNo(DetailAST ast)Finds column number in the first non-comment node.private static intDetailAST. findLineNo(DetailAST ast)Finds line number in the first non-comment node.voidAbstractCheck. finishTree(DetailAST rootAST)Called after finished processing a tree.voidAbstractCheck. leaveToken(DetailAST ast)Called after all the child nodes have been process.protected voidAbstractViolationReporter. log(DetailAST ast, java.lang.String key, java.lang.Object... args)Helper method to log a LocalizedMessage.private voidDetailAST. setParent(DetailAST parent)Set the parent token.voidAbstractCheck. 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 DetailASTOuterTypeFilenameCheck. wrongTypeOuter 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. framesDeprecated.Tree of all the parsed frames.Methods in com.puppycrawl.tools.checkstyle.checks that return DetailAST Modifier and Type Method Description private static DetailASTSuppressWarningsHolder. 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 DetailASTSuppressWarningsHolder. getAnnotationTarget(DetailAST ast)Get target of annotation.private static DetailASTSuppressWarningsHolder. 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 voidAbstractDeclarationCollector. beginTree(DetailAST rootAST)Deprecated.voidAbstractTypeAwareCheck. beginTree(DetailAST rootAST)Deprecated.voidAvoidEscapedUnicodeCharactersCheck. beginTree(DetailAST rootAST)voidFileContentsHolder. beginTree(DetailAST rootAST)voidOuterTypeFilenameCheck. beginTree(DetailAST rootAST)voidSuppressWarningsHolder. beginTree(DetailAST rootAST)voidTrailingCommentCheck. beginTree(DetailAST rootAST)voidUncommentedMainCheck. beginTree(DetailAST rootAST)private static booleanUncommentedMainCheck. checkModifiers(DetailAST method)Checks that method has final and static modifiers.private static booleanUncommentedMainCheck. checkName(DetailAST method)Checks that method name is @quot;main@quot;.private voidFinalParametersCheck. checkParam(DetailAST param)Checks if the given parameter is final.private static booleanUncommentedMainCheck. checkParams(DetailAST method)Checks that method has onlyString[]or onlyString...param.private static booleanUncommentedMainCheck. checkType(DetailAST method)Checks that return type isvoid.private static voidAbstractDeclarationCollector. collectDeclarations(java.util.Deque<AbstractDeclarationCollector.LexicalFrame> frameStack, DetailAST ast)Deprecated.Parse the next AST for declarations.private static voidAbstractDeclarationCollector. collectVariableDeclarations(DetailAST ast, AbstractDeclarationCollector.LexicalFrame frame)Deprecated.Collect Variable Declarations.private voidAbstractDeclarationCollector. 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.voidOuterTypeFilenameCheck. finishTree(DetailAST rootAST)private static DetailASTSuppressWarningsHolder. 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 DetailASTSuppressWarningsHolder. 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.StringSuppressWarningsHolder. getIdentifier(DetailAST ast)Returns the Java identifier represented by an AST.private static DetailASTSuppressWarningsHolder. getNthChild(DetailAST ast, int index)Returns the n'th child of an AST node.private static java.lang.StringSuppressWarningsHolder. getStringExpr(DetailAST ast)Returns the literal string expression represented by an AST.private booleanAvoidEscapedUnicodeCharactersCheck. hasTrailComment(DetailAST ast)Check if trail comment is present after ast token.private booleanFinalParametersCheck. isIgnoredParam(DetailAST paramDef)Checks for skip current param due to ignorePrimitiveTypes option.private static booleanUncommentedMainCheck. isStringType(DetailAST typeAst)Whether the type is java.lang.String.voidAbstractTypeAwareCheck. leaveToken(DetailAST ast)Deprecated.voidUncommentedMainCheck. leaveToken(DetailAST ast)private voidDescendantTokenCheck. logAsSeparated(DetailAST ast)Log violations for each Token.private voidDescendantTokenCheck. logAsTotal(DetailAST ast)Log validation as one violation.protected abstract voidAbstractTypeAwareCheck. processAST(DetailAST ast)Deprecated.Called to process an AST when visiting it.private voidAbstractTypeAwareCheck. processClass(DetailAST ast)Deprecated.Processes class definition.private voidAbstractTypeAwareCheck. processImport(DetailAST ast)Deprecated.Collects the details of imports.private voidAbstractTypeAwareCheck. processPackage(DetailAST ast)Deprecated.Collects the details of a package.private voidAbstractTypeAwareCheck. processTypeParams(DetailAST ast)Deprecated.Process type params (if any) for given class, enum or method.private voidFinalParametersCheck. visitCatch(DetailAST catchClause)Checks parameter of the catch block.private voidUncommentedMainCheck. visitClassDef(DetailAST classDef)If not inner class then change current class name.private voidFinalParametersCheck. visitForEachClause(DetailAST forEachClause)Checks parameter of the for each clause.private voidFinalParametersCheck. visitMethod(DetailAST method)Checks parameters of the method or ctor.private voidUncommentedMainCheck. visitMethodDef(DetailAST method)Checks method definition if this ispublic static void main(String[]).private voidUncommentedMainCheck. visitPackageDef(DetailAST packageDef)Sets current package.voidAbstractDeclarationCollector. visitToken(DetailAST ast)Deprecated.voidAbstractTypeAwareCheck. visitToken(DetailAST ast)Deprecated.voidArrayTypeStyleCheck. visitToken(DetailAST ast)voidAvoidEscapedUnicodeCharactersCheck. visitToken(DetailAST ast)voidDescendantTokenCheck. visitToken(DetailAST ast)voidFinalParametersCheck. visitToken(DetailAST ast)voidOuterTypeFilenameCheck. visitToken(DetailAST ast)voidSuppressWarningsHolder. visitToken(DetailAST ast)voidTodoCommentCheck. visitToken(DetailAST ast)voidTrailingCommentCheck. visitToken(DetailAST ast)voidUncommentedMainCheck. visitToken(DetailAST ast)voidUpperEllCheck. 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 DetailASTSuppressWarningsCheck. findWarningsHolder(DetailAST annotation)Find the parent (holder) of the of the warnings (Expr).private static DetailASTSuppressWarningsCheck. getCondLeft(DetailAST cond)Retrieves the left side of a conditional.private static DetailASTSuppressWarningsCheck. getCondRight(DetailAST cond)Retrieves the right side of a conditional.private static DetailASTSuppressWarningsCheck. getSuppressWarnings(DetailAST ast)Gets theSuppressWarningsannotation that is annotating the AST.Methods in com.puppycrawl.tools.checkstyle.checks.annotation with parameters of type DetailAST Modifier and Type Method Description private voidAnnotationLocationCheck. checkAnnotations(DetailAST modifierNode, int correctIndentation)Checks annotations positions in code: 1) Checks whether the annotations locations are correct.private voidAnnotationUseStyleCheck. checkCheckClosingParens(DetailAST ast)Checks to see if the closing parenthesis are present if required or prohibited.private voidAnnotationUseStyleCheck. checkCompactNoArrayStyle(DetailAST annotation)Checks for compact no array style type violations.private voidAnnotationUseStyleCheck. checkCompactStyle(DetailAST annotation)Checks for compact style type violations.private voidAnnotationUseStyleCheck. checkExpandedStyle(DetailAST annotation)Checks for expanded style type violations.private voidAnnotationUseStyleCheck. checkStyleType(DetailAST annotation)Checks to see if theAnnotationElementStyleis correct.private voidAnnotationUseStyleCheck. checkTrailingComma(DetailAST annotation)Checks to see if the trailing comma is present if required or prohibited.private static DetailASTSuppressWarningsCheck. findWarningsHolder(DetailAST annotation)Find the parent (holder) of the of the warnings (Expr).private static java.lang.StringAnnotationLocationCheck. getAnnotationName(DetailAST annotation)Returns the name of the given annotation.private static DetailASTSuppressWarningsCheck. getCondLeft(DetailAST cond)Retrieves the left side of a conditional.private static DetailASTSuppressWarningsCheck. getCondRight(DetailAST cond)Retrieves the right side of a conditional.private static intAnnotationLocationCheck. getExpectedAnnotationIndentation(DetailAST modifierNode)Returns an expected annotation indentation.private static DetailASTSuppressWarningsCheck. getSuppressWarnings(DetailAST ast)Gets theSuppressWarningsannotation that is annotating the AST.private static booleanAnnotationLocationCheck. hasAnnotations(DetailAST modifierNode)Checks whether a given modifier node has an annotation.private static booleanAnnotationLocationCheck. hasNodeAfter(DetailAST annotation)Checks whether an annotation node has any node after on the same line.private static booleanAnnotationLocationCheck. hasNodeBefore(DetailAST annotation)Checks whether an annotation node has any node before on the same line.private static booleanAnnotationLocationCheck. hasNodeBeside(DetailAST annotation)Checks whether an annotation node has any node before or after on the same line.static booleanAnnotationLocationCheck. isAllowedPosition(DetailAST annotation, int... allowedPositions)Checks whether position of annotation is allowed.private booleanAnnotationLocationCheck. isCorrectLocation(DetailAST annotation, boolean hasParams)Checks whether an annotation has a correct location.private static booleanAnnotationLocationCheck. isInSpecificCodeBlock(DetailAST node, int blockType)Checks whether the scope of a node is restricted to a specific code block.private static booleanAnnotationLocationCheck. isParameterized(DetailAST annotation)Checks whether an annotation has parameters.private voidAnnotationUseStyleCheck. logCommaViolation(DetailAST ast)Logs a trailing array comma violation if one exists.voidAnnotationLocationCheck. visitToken(DetailAST ast)voidAnnotationUseStyleCheck. visitToken(DetailAST ast)voidMissingDeprecatedCheck. visitToken(DetailAST ast)voidMissingOverrideCheck. visitToken(DetailAST ast)voidPackageAnnotationCheck. visitToken(DetailAST ast)voidSuppressWarningsCheck. visitToken(DetailAST ast)private voidSuppressWarningsCheck. 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 DetailASTRightCurlyCheck.Details. lcurlyLeft curly.private DetailASTRightCurlyCheck.Details. nextTokenNext token.private DetailASTRightCurlyCheck.Details. rcurlyRight curly.Methods in com.puppycrawl.tools.checkstyle.checks.blocks that return DetailAST Modifier and Type Method Description private static DetailASTLeftCurlyCheck. findLastAnnotation(DetailAST modifiers)Find the last token of typeTokenTypes.ANNOTATIONunder the given set of modifiers.private static DetailASTEmptyBlockCheck. findLeftCurly(DetailAST ast)Calculates the left curly corresponding to the block to be checked.private static DetailASTLeftCurlyCheck. getFirstAnnotationOnSameLine(DetailAST annotation)Returns first annotation on same line.private static DetailASTRightCurlyCheck.Details. getNextToken(DetailAST ast)Finds next token after the given one.private static DetailASTLeftCurlyCheck. skipAnnotationOnlyLines(DetailAST ast)Skip lines that only containTokenTypes.ANNOTATIONs.Methods in com.puppycrawl.tools.checkstyle.checks.blocks with parameters of type DetailAST Modifier and Type Method Description private static DetailASTLeftCurlyCheck. findLastAnnotation(DetailAST modifiers)Find the last token of typeTokenTypes.ANNOTATIONunder the given set of modifiers.private static DetailASTEmptyBlockCheck. findLeftCurly(DetailAST ast)Calculates the left curly corresponding to the block to be checked.private static java.lang.StringEmptyCatchBlockCheck. getCommentFirstLine(DetailAST catchAst)Gets the first line of comment in catch block.private static RightCurlyCheck.DetailsRightCurlyCheck.Details. getDetails(DetailAST ast)Collects validation Details.private static RightCurlyCheck.DetailsRightCurlyCheck.Details. getDetailsForIfElse(DetailAST ast)Collects validation details for LITERAL_IF and LITERAL_ELSE.private static RightCurlyCheck.DetailsRightCurlyCheck.Details. getDetailsForLambda(DetailAST ast)Collects validation details for Lambdas.private static RightCurlyCheck.DetailsRightCurlyCheck.Details. getDetailsForLoops(DetailAST ast)Collects validation details for loops' tokens.private static RightCurlyCheck.DetailsRightCurlyCheck.Details. getDetailsForOthers(DetailAST ast)Collects validation details for CLASS_DEF, METHOD DEF, CTOR_DEF, STATIC_INIT, and INSTANCE_INIT.private static RightCurlyCheck.DetailsRightCurlyCheck.Details. getDetailsForTryCatchFinally(DetailAST ast)Collects validation details for LITERAL_TRY, LITERAL_CATCH, and LITERAL_FINALLY.private static java.lang.StringEmptyCatchBlockCheck. getExceptionVariableName(DetailAST catchAst)Gets variable's name associated with exception.private static DetailASTLeftCurlyCheck. getFirstAnnotationOnSameLine(DetailAST annotation)Returns first annotation on same line.private static DetailASTRightCurlyCheck.Details. getNextToken(DetailAST ast)Finds next token after the given one.private booleanLeftCurlyCheck. hasLineBreakAfter(DetailAST leftCurly)Checks if left curly has line break after.private static booleanRightCurlyCheck. hasLineBreakBefore(DetailAST rightCurly)Checks if right curly has line break before.protected booleanEmptyBlockCheck. hasText(DetailAST slistAST)Checks if SLIST token contains any text.private static booleanRightCurlyCheck. isAnonInnerClassInit(DetailAST lcurly)Checks whether lcurly is in anonymous inner class initialization.private booleanNeedBracesCheck. isDefaultInAnnotation(DetailAST ast)Checks if ast is the default token of an annotation field.private static booleanRightCurlyCheck. isEmptyBody(DetailAST lcurly)Checks if definition body is empty.private static booleanEmptyCatchBlockCheck. isEmptyCatchBlock(DetailAST catchAst)Checks if catch block is empty or contains only comments.private static booleanNeedBracesCheck. isEmptyLoopBody(DetailAST ast)Checks if current loop statement does not have body, e.g.:private static booleanNeedBracesCheck. isSingleLineCase(DetailAST literalCase)Checks if current case statement is single-line statement, e.g.:private static booleanNeedBracesCheck. isSingleLineDefault(DetailAST literalDefault)Checks if current default statement is single-line statement, e.g.:private static booleanNeedBracesCheck. isSingleLineDoWhile(DetailAST literalDo)Checks if current do-while statement is single-line statement, e.g.:private static booleanNeedBracesCheck. isSingleLineElse(DetailAST literalElse)Checks if current else statement is single-line statement, e.g.:private static booleanNeedBracesCheck. isSingleLineFor(DetailAST literalFor)Checks if current for statement is single-line statement, e.g.:private static booleanNeedBracesCheck. isSingleLineIf(DetailAST literalIf)Checks if current if statement is single-line statement, e.g.:private static booleanNeedBracesCheck. isSingleLineLambda(DetailAST lambda)Checks if current lambda statement is single-line statement, e.g.:private static booleanNeedBracesCheck. isSingleLineStatement(DetailAST statement)Checks if current statement is single-line statement, e.g.:private static booleanNeedBracesCheck. isSingleLineWhile(DetailAST literalWhile)Checks if current while statement is single-line statement, e.g.:private booleanNeedBracesCheck. isSkipStatement(DetailAST statement)Checks if current statement can be skipped by "need braces" warning.private booleanEmptyCatchBlockCheck. 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 DetailASTLeftCurlyCheck. skipAnnotationOnlyLines(DetailAST ast)Skip lines that only containTokenTypes.ANNOTATIONs.private voidLeftCurlyCheck. validateEol(DetailAST brace, java.lang.String braceLine)Validate EOL case.private voidLeftCurlyCheck. validateNewLinePosition(DetailAST brace, DetailAST startToken, java.lang.String braceLine)Validate token on new Line position.private voidLeftCurlyCheck. verifyBrace(DetailAST brace, DetailAST startToken)Verifies that a specified left curly brace is placed correctly according to policy.private voidEmptyCatchBlockCheck. visitCatchBlock(DetailAST catchAst)Visits catch ast node, if it is empty catch block - checks it according to Check's options.voidAvoidNestedBlocksCheck. visitToken(DetailAST ast)voidEmptyBlockCheck. visitToken(DetailAST ast)voidEmptyCatchBlockCheck. visitToken(DetailAST ast)voidLeftCurlyCheck. visitToken(DetailAST ast)voidNeedBracesCheck. visitToken(DetailAST ast)voidRightCurlyCheck. 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 DetailASTRequireThisCheck.AbstractFrame. frameNameIdentName identifier token.private DetailASTAbstractSuperCheck.MethodNode. methodMethod definition.private DetailASTUnnecessaryParenthesesCheck. parentToSkipUsed 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 DetailASTFinalLocalVariableCheck.FinalVariableCandidate. variableIdentIdentifier 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. currentScopeAssignedVariablesAssigned variables of current scope.private java.util.Set<DetailAST>CovariantEqualsCheck. equalsMethodsSet of equals method definitions.private java.util.Set<DetailAST>EqualsAvoidNullCheck.FieldFrame. fieldsSet of fields.private java.util.Map<DetailAST,RequireThisCheck.AbstractFrame>RequireThisCheck. framesTree of all the parsed frames.private java.util.Set<DetailAST>RequireThisCheck.ClassFrame. instanceMembersSet of idents of instance members declared in this frame.private java.util.Set<DetailAST>RequireThisCheck.ClassFrame. instanceMethodsSet of idents of instance methods declared in this frame.private java.util.Set<DetailAST>IllegalInstantiationCheck. instantiationsThe instantiations in the file.private java.util.Set<DetailAST>EqualsAvoidNullCheck.FieldFrame. methodCallsSet of equals calls.private java.util.Map<DetailAST,DetailAST>EqualsHashCodeCheck. objBlockWithEqualsMaps OBJ_BLOCK to the method definition of equals().private java.util.Map<DetailAST,DetailAST>EqualsHashCodeCheck. objBlockWithEqualsMaps OBJ_BLOCK to the method definition of equals().private java.util.Map<DetailAST,DetailAST>EqualsHashCodeCheck. objBlockWithHashCodeMaps OBJ_BLOCKs to the method definition of hashCode().private java.util.Map<DetailAST,DetailAST>EqualsHashCodeCheck. objBlockWithHashCodeMaps OBJ_BLOCKs to the method definition of hashCode().private java.util.Deque<java.util.Deque<DetailAST>>FinalLocalVariableCheck. prevScopeUninitializedVariablesUninitialized variables of previous scope.private java.util.Set<DetailAST>RequireThisCheck.ClassFrame. staticMembersSet of idents of variables declared in this frame.private java.util.Set<DetailAST>RequireThisCheck.ClassFrame. staticMethodsSet of idents of static methods declared in this frame.private java.util.Deque<DetailAST>FinalLocalVariableCheck.ScopeData. uninitializedVariablesContains definitions of uninitialized variables.private java.util.Set<DetailAST>RequireThisCheck.AbstractFrame. varIdentsSet 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 DetailASTMagicNumberCheck. findContainingConstantDef(DetailAST ast)Finds the constant definition that contains aAST.DetailASTEqualsAvoidNullCheck.FieldFrame. findField(java.lang.String name)Determines whether this FieldFrame contains the field.private static DetailASTFinalLocalVariableCheck. findFirstUpperNamedBlock(DetailAST ast)Find the Class, Constructor, Enum, Method, or Field in which it is defined.private static DetailASTFinalLocalVariableCheck. 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 DetailASTDefaultComesLastCheck. findNextSibling(DetailAST ast, int tokenType)Return token type only if passed tokenType in argument is found or returns -1.private static DetailASTRequireThisCheck. getBlockEndToken(DetailAST blockNameIdent, DetailAST blockStartToken)Returns the token which ends the code block.private static DetailASTRequireThisCheck. getCodeBlockDefinitionToken(DetailAST ident)Returns code block definition token for current identifier.private static DetailASTVariableDeclarationUsageDistanceCheck. 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 DetailASTVariableDeclarationUsageDistanceCheck. 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 DetailASTVariableDeclarationUsageDistanceCheck. 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 DetailASTVariableDeclarationUsageDistanceCheck. 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!).DetailASTRequireThisCheck.AbstractFrame. getFrameNameIdent()private static DetailASTMultipleVariableDeclarationsCheck. getLastNode(DetailAST node)Finds sub-node for given node maximum (line, column) pair.DetailASTAbstractSuperCheck.MethodNode. getMethod()Returns the overriding method definition AST.private static DetailASTIllegalTypeCheck. 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 DetailASTEqualsAvoidNullCheck. 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 voidEqualsAvoidNullCheck.FieldFrame. addField(DetailAST field)Add field to this FieldFrame.private voidRequireThisCheck.AbstractFrame. addIdent(DetailAST identToAdd)Add a name to the frame.voidRequireThisCheck.ClassFrame. addInstanceMember(DetailAST ident)Adds instance member's ident.voidRequireThisCheck.ClassFrame. addInstanceMethod(DetailAST ident)Adds instance method's name.voidEqualsAvoidNullCheck.FieldFrame. addMethodCall(DetailAST methodCall)Add method call to this frame.voidRequireThisCheck.ClassFrame. addStaticMember(DetailAST ident)Adds static member's ident.voidRequireThisCheck.ClassFrame. addStaticMethod(DetailAST ident)Adds static method's name.voidAbstractNestedDepthCheck. beginTree(DetailAST rootAST)Deprecated.voidAbstractSuperCheck. beginTree(DetailAST rootAST)voidDeclarationOrderCheck. beginTree(DetailAST rootAST)voidEqualsAvoidNullCheck. beginTree(DetailAST rootAST)voidEqualsHashCodeCheck. beginTree(DetailAST rootAST)voidHiddenFieldCheck. beginTree(DetailAST rootAST)voidIllegalInstantiationCheck. beginTree(DetailAST rootAST)voidModifiedControlVariableCheck. beginTree(DetailAST rootAST)voidMultipleStringLiteralsCheck. beginTree(DetailAST rootAST)voidNestedForDepthCheck. beginTree(DetailAST rootAST)voidNestedIfDepthCheck. beginTree(DetailAST rootAST)voidNestedTryDepthCheck. beginTree(DetailAST rootAST)voidOneStatementPerLineCheck. beginTree(DetailAST rootAST)voidPackageDeclarationCheck. beginTree(DetailAST ast)voidParameterAssignmentCheck. beginTree(DetailAST rootAST)voidRequireThisCheck. beginTree(DetailAST rootAST)voidReturnCountCheck. 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 booleanRequireThisCheck. canAssignValueToClassField(DetailAST ast)Checks whether a value can be assigned to a field.private booleanRequireThisCheck. canBeReferencedFromStaticContext(DetailAST ident)Checks whether a field can be referenced from a static context.private voidIllegalTypeCheck. checkClassName(DetailAST ast)Checks type of given method, parameter or variable.voidReturnCountCheck.Context. checkCount(DetailAST ast)Checks if number of return statements in the method are more than allowed.private voidModifiedControlVariableCheck. checkIdent(DetailAST ast)Check if ident is parameter.private voidParameterAssignmentCheck. checkIdent(DetailAST ast)Check if ident is parameter.private booleanFallThroughCheck. checkIf(DetailAST ast, boolean useBreak, boolean useContinue)Checks if a given IF terminated by return, throw or, if allowed break, continue.private voidOneStatementPerLineCheck. checkIfSemicolonIsInDifferentLineThanPrevious(DetailAST ast)Checks if given semicolon is in different line than previous.private static booleanEqualsAvoidNullCheck. checkLineNo(DetailAST field, DetailAST objCalledOn)Check whether the field is declared before the method call in case of methods and initialization blocks.private booleanFallThroughCheck. checkLoop(DetailAST ast)Checks if a given loop terminated by return, throw or, if allowed break, continue.private voidEqualsAvoidNullCheck. checkMethodCall(DetailAST methodCall)Check whether the method call should be violated.private voidOverloadMethodsDeclarationOrderCheck. checkOverloadMethodsGrouping(DetailAST objectBlock)Checks that if overload methods are grouped together they should not be separated from each other.private static booleanRequireThisCheck.AbstractFrame. checkPosition(DetailAST ast1, DetailAST ast2)Whether the declaration is located before the checked ast.private booleanFallThroughCheck. checkSlist(DetailAST slistAst, boolean useBreak, boolean useContinue)Checks if a given SLIST terminated by return, throw or, if allowed break, continue.private booleanFallThroughCheck. checkSwitch(DetailAST literalSwitchAst, boolean useContinue)Checks if a given switch terminated by return, throw or, if allowed break, continue.private booleanFallThroughCheck. 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 voidRequireThisCheck. collectDeclarations(java.util.Deque<RequireThisCheck.AbstractFrame> frameStack, DetailAST ast)Parses the next AST for declarations.private static voidRequireThisCheck. collectVariableDeclarations(DetailAST ast, RequireThisCheck.AbstractFrame frame)Collects variable declarations.private static booleanEqualsAvoidNullCheck. containsAllSafeTokens(DetailAST expr)Looks for all "safe" Token combinations in the argument expression branch.private static booleanMissingSwitchDefaultCheck. containsDefaultSwitch(DetailAST caseGroupAst)Checks if the case group or its sibling contain the 'default' switch.protected booleanRequireThisCheck.AbstractFrame. containsFieldOrVariable(DetailAST nameToFind)Check whether the frame contains a field or a variable with the given name.protected booleanRequireThisCheck.ClassFrame. containsFieldOrVariable(DetailAST nameToFind)protected booleanRequireThisCheck.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 booleanRequireThisCheck.ClassFrame. containsMethod(DetailAST methodToFind)Check whether the frame contains a given method.private static booleanRequireThisCheck.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 booleanEqualsAvoidNullCheck. containsOneArgument(DetailAST methodCall)Verify that method call has one argument.private static java.lang.StringIllegalTokenCheck. convertToString(DetailAST ast)Converts given AST node to string representation.private static voidFinalLocalVariableCheck. determineAssignmentConditions(DetailAST ident, FinalLocalVariableCheck.FinalVariableCandidate candidate)Determines identifier assignment conditions (assigned or already assigned).private voidRequireThisCheck. 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.AbstractFrameRequireThisCheck. findClassFrame(DetailAST name, boolean lookForMethod)Find the class frame containing declaration.private static DetailASTMagicNumberCheck. 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 DetailASTFinalLocalVariableCheck. findFirstUpperNamedBlock(DetailAST ast)Find the Class, Constructor, Enum, Method, or Field in which it is defined.private RequireThisCheck.AbstractFrameRequireThisCheck. findFrame(DetailAST name, boolean lookForMethod)Find frame containing declaration.private static RequireThisCheck.AbstractFrameRequireThisCheck. findFrame(RequireThisCheck.AbstractFrame frame, DetailAST name, boolean lookForMethod)Find frame containing declaration.private static DetailASTFinalLocalVariableCheck. 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 DetailASTDefaultComesLastCheck. findNextSibling(DetailAST ast, int tokenType)Return token type only if passed tokenType in argument is found or returns -1.voidEqualsAvoidNullCheck. finishTree(DetailAST ast)voidEqualsHashCodeCheck. finishTree(DetailAST rootAST)voidIllegalInstantiationCheck. finishTree(DetailAST rootAST)voidMultipleStringLiteralsCheck. finishTree(DetailAST rootAST)voidPackageDeclarationCheck. 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 DetailASTRequireThisCheck. getBlockEndToken(DetailAST blockNameIdent, DetailAST blockStartToken)Returns the token which ends the code block.private RequireThisCheck.AbstractFrameRequireThisCheck. getClassFrameWhereViolationIsFound(DetailAST ast)Returns the class frame where violation is found (where the field is used without 'this') or null otherwise.private static DetailASTRequireThisCheck. getCodeBlockDefinitionToken(DetailAST ident)Returns code block definition token for current identifier.private static intVariableDeclarationUsageDistanceCheck. getDistToVariableUsageInChildNode(DetailAST childNode, DetailAST varIdent, int currentDistToVarUsage)Returns the distance to variable usage for in the child node.private static java.lang.StringEqualsAvoidNullCheck.FieldFrame. getFieldName(DetailAST field)Get the name of the field.private static java.lang.StringEqualsAvoidNullCheck. getFieldType(DetailAST field)Get field type.private RequireThisCheck.AbstractFrameRequireThisCheck. 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 DetailASTVariableDeclarationUsageDistanceCheck. 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 DetailASTVariableDeclarationUsageDistanceCheck. 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 DetailASTVariableDeclarationUsageDistanceCheck. 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 DetailASTVariableDeclarationUsageDistanceCheck. 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.AbstractFrameRequireThisCheck.AbstractFrame. getIfContains(DetailAST nameToFind, boolean lookForMethod)Check whether the frame contains a given name.protected RequireThisCheck.AbstractFrameRequireThisCheck.ClassFrame. getIfContains(DetailAST nameToFind, boolean lookForMethod)private static java.lang.StringIllegalTypeCheck. getImportedTypeCanonicalName(DetailAST importAst)Gets imported type's canonical name.private static java.lang.StringVariableDeclarationUsageDistanceCheck. getInstanceName(DetailAST methodCallAst)Get name of instance whose method is called.private static DetailASTMultipleVariableDeclarationsCheck. getLastNode(DetailAST node)Finds sub-node for given node maximum (line, column) pair.private RequireThisCheck.AbstractFrameRequireThisCheck. getMethodWithoutThis(DetailAST ast)Returns the frame where the method is declared, if the given method is used without 'this' and null otherwise.private static DetailASTIllegalTypeCheck. 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 booleanAbstractSuperCheck. hasArguments(DetailAST methodCallDotAst)Does method have any arguments.private booleanFallThroughCheck. hasFallThroughComment(DetailAST currentCase, DetailAST nextCase)Determines if the fall through case betweencurrentCaseandnextCaseis relieved by a appropriate comment.booleanRequireThisCheck.ClassFrame. hasFinalField(DetailAST instanceMember)Checks whether given instance member has final modifier.booleanRequireThisCheck.ClassFrame. hasInstanceMember(DetailAST ident)Checks if a given name is a known instance member of the class.booleanRequireThisCheck.ClassFrame. hasInstanceMethod(DetailAST ident)Checks if a given name is a known instance method of the class.booleanRequireThisCheck.ClassFrame. hasStaticMethod(DetailAST ident)Checks if a given name is a known static method of the class.private voidFinalLocalVariableCheck. insertParameter(DetailAST ast)Insert a parameter at the topmost scope stack.private voidFinalLocalVariableCheck. insertVariable(DetailAST ast)Insert a variable at the topmost scope stack.private static booleanRequireThisCheck. isAnonymousClassDef(DetailAST ast)Whether the AST is a definition of an anonymous class.private booleanEqualsAvoidNullCheck. isCalledOnStringFieldOrVariable(DetailAST objCalledOn)Determine, whether equals method is called on a field of String type.private static booleanFinalLocalVariableCheck. isCaseTokenWithAnotherCaseFollowing(DetailAST ast)If token is CASE_GROUP and there is anothercasefollowing.private booleanIllegalTypeCheck. isCheckedMethod(DetailAST ast)Returns true if method has to be checked or false.private static booleanVariableDeclarationUsageDistanceCheck. isChild(DetailAST parent, DetailAST ast)Checks if Ast node contains given element.private static booleanMagicNumberCheck. isChildOf(DetailAST ast, int type)Determines if the given AST node has a parent node with given token type code.private static booleanInnerAssignmentCheck. isComparison(DetailAST ast)Checks if an AST is a comparison operator.private booleanIllegalTypeCheck. isContainVerifiableType(DetailAST modifiers)Checks is modifiers contain verifiable type.private static booleanEqualsHashCodeCheck. isEqualsMethod(DetailAST ast)Determines if an AST is a valid Equals method implementation.private static booleanUnnecessaryParenthesesCheck. isExprSurrounded(DetailAST ast)Tests if the given expression node is surrounded by parentheses.private static booleanMagicNumberCheck. isFieldDeclaration(DetailAST ast)Determines whether or not the given AST is field declaration.private static booleanFinalLocalVariableCheck. isFirstChild(DetailAST ast)Whether the ast is the first child of its parent.private static booleanCovariantEqualsCheck. isFirstParameterObject(DetailAST methodDefAst)Tests whether a method's first parameter is an Object.private booleanDeclarationOrderCheck. isForwardReference(DetailAST fieldDef)Checks whether an identifier references a field which has been already defined in class.private static booleanEqualsHashCodeCheck. isHashCodeMethod(DetailAST ast)Determines if an AST is a valid HashCode method implementation.private static booleanFinalLocalVariableCheck. isIfTokenWithAnElseFollowing(DetailAST ast)If token is LITERAL_IF and there is anelsefollowing.private booleanIllegalThrowsCheck. isIgnorableMethod(DetailAST methodDef)Checks if current method is ignorable due to Check's properties.private booleanHiddenFieldCheck. isIgnoredConstructorParam(DetailAST ast)Decides whether to ignore an AST node that is the parameter of a constructor.private booleanHiddenFieldCheck. isIgnoredParam(DetailAST ast, java.lang.String name)Checks whether method or constructor parameter is ignored.private booleanHiddenFieldCheck. isIgnoredParamOfAbstractMethod(DetailAST ast)Decides whether to ignore an AST node that is the parameter of an abstract method.private booleanHiddenFieldCheck. 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 booleanFinalLocalVariableCheck. isInAbstractOrNativeMethod(DetailAST ast)Determines whether an AST is a descendant of an abstract or native method.private static booleanInnerAssignmentCheck. isInContext(DetailAST ast, int[]... contextSet)Tests whether the provided AST is in one of the given contexts.private static booleanMagicNumberCheck. isInHashCodeMethod(DetailAST ast)Determines whether or not the given AST is in a valid hash code method.private booleanMagicNumberCheck. isInIgnoreList(DetailAST ast)Decides whether the number of an AST is in the ignore list of this check.private booleanMultipleStringLiteralsCheck. isInIgnoreOccurrenceContext(DetailAST ast)Analyses the path from the AST root to a given AST for occurrences of the token types inMultipleStringLiteralsCheck.ignoreOccurrenceContext.private static booleanVariableDeclarationUsageDistanceCheck. isInitializationSequence(DetailAST variableUsageAst, java.lang.String variableName)Processes statements until usage of variable to detect sequence of initialization methods.private static booleanFinalLocalVariableCheck. isInitialized(DetailAST ast)Check if VARIABLE_DEF is initialized or not.private static booleanFinalLocalVariableCheck. isInLambda(DetailAST paramDef)Check if current param is lambda's param.private static booleanInnerAssignmentCheck. isInNoBraceControlStatement(DetailAST ast)Determines if ast is in the body of a flow control statement without braces.private static booleanFinalLocalVariableCheck. isInSpecificCodeBlock(DetailAST node, int blockType)Checks whether the scope of a node is restricted to a specific code block.private static booleanHiddenFieldCheck. isInStatic(DetailAST ast)Determines whether an AST node is in a static method or static initializer.private static booleanFinalLocalVariableCheck. isInTheSameLoop(DetailAST ast1, DetailAST ast2)Check if both the variables are in the same loop.private static booleanInnerAssignmentCheck. isInWhileIdiom(DetailAST ast)Tests whether the given AST is used in the "assignment in while" idiom.private static booleanRequireThisCheck. isLambdaParameter(DetailAST ast)Checks if the token is a Lambda parameter.private booleanMagicNumberCheck. isMagicNumberExists(DetailAST ast, DetailAST constantDefAST)Is magic number some where at ast tree.private static booleanOneStatementPerLineCheck. isMultilineStatement(DetailAST ast)Checks whether statement is multiline.private booleanFinalLocalVariableCheck. isMultipleTypeCatch(DetailAST parameterDefAst)Check if given parameter definition is a multiple type catch.private static booleanEqualsHashCodeCheck. isObjectParam(DetailAST paramNode)Determines if an AST is a formal param of type Object.private static booleanExplicitInitializationCheck. isObjectType(DetailAST type)Determines if a given type is an object type.private static booleanEqualsAvoidNullCheck. isObjectValid(DetailAST objCalledOn)Check whether the object equals method is called on is not a String literal and not too complex.private static booleanOneStatementPerLineCheck. isOnTheSameLine(DetailAST ast, int lastStatementEnd, int forStatementEnd, int lambdaStatementEnd)Checks whether two statements are on the same line.private booleanRequireThisCheck. isOverlappingByArgument(DetailAST ast)Checks whether an overlapping by method or constructor argument takes place.private booleanRequireThisCheck. isOverlappingByLocalVariable(DetailAST ast)Checks whether an overlapping by local variable takes place.private booleanAbstractSuperCheck. isOverridingMethod(DetailAST ast)Determines whether an AST is a method definition for this check, with 0 parameters.protected booleanRequireThisCheck.AbstractFrame. isProperDefinition(DetailAST ident, DetailAST ast)Whether the definition is correspondent to the IDENT.protected booleanRequireThisCheck.ClassFrame. isProperDefinition(DetailAST ident, DetailAST ast)private static booleanRequireThisCheck. isReturnedVariable(RequireThisCheck.AbstractFrame currentFrame, DetailAST ident)Checks whether the current variable is returned from the method.private booleanAbstractSuperCheck. isSameNameMethod(DetailAST ast)Is same name of method.private static booleanFinalLocalVariableCheck. isSameVariables(DetailAST ast1, DetailAST ast2)Check if both the Variables are same.private booleanHiddenFieldCheck. 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 booleanRequireThisCheck.ClassFrame. isSimilarSignature(DetailAST ident, DetailAST ast)Whether the method definition has the same name and number of parameters.private static booleanExplicitInitializationCheck. isSkipCase(DetailAST ast)Checks for cases that should be skipped: no assignment, local variable, final variables.private static booleanIllegalTypeCheck. isStarImport(DetailAST importAst)Checks if current import is star import.private booleanHiddenFieldCheck. isStaticFieldHiddenFromAnonymousClass(DetailAST nameAST, java.lang.String name)Checks whether a static field is hidden from closure.private booleanHiddenFieldCheck. isStaticOrInstanceField(DetailAST ast, java.lang.String name)Check for static or instance field.private booleanEqualsAvoidNullCheck. isStringFieldOrVariable(DetailAST objCalledOn)Whether the field or the variable is of String type.private booleanEqualsAvoidNullCheck. isStringFieldOrVariableFromClass(DetailAST objCalledOn, java.lang.String className)Whether the field or the variable from the specified class is of String type.private booleanEqualsAvoidNullCheck. isStringFieldOrVariableFromThisInstance(DetailAST objCalledOn)Whether the field or the variable from THIS instance is of String type.private static booleanEqualsAvoidNullCheck. isStringLiteral(DetailAST objCalledOn)Checks for calling equals on String literal and anon object which cannot be null.private booleanAbstractSuperCheck. isSuperCall(DetailAST literalSuperAst)Determines whether a 'super' literal is a call to the super method for this check.private booleanAbstractSuperCheck. isSuperCallInOverridingMethod(DetailAST ast)Determines whether a super call in overriding method.private static booleanUnnecessaryParenthesesCheck. isSurrounded(DetailAST ast)Tests if the givenDetailASTis surrounded by parentheses.private booleanFallThroughCheck. isTerminated(DetailAST ast, boolean useBreak, boolean useContinue)Checks if a given subtree terminated by return, throw or, if allowed break, continue.private static booleanFinalLocalVariableCheck. isUseOfExternalVariableInsideLoop(DetailAST variable)Checks whether a variable which is declared outside loop is used inside loop.private static booleanRequireThisCheck. isUserDefinedArrangementOfThis(RequireThisCheck.AbstractFrame currentFrame, DetailAST ident)Checks whether user arranges 'this' for variable in method, constructor, or block on his own.private static booleanFinalLocalVariableCheck. isVariableInForInit(DetailAST variableDef)Checks if current variable is defined infor-loop init, e.g.:private static booleanVariableDeclarationUsageDistanceCheck. isVariableInOperatorExpr(DetailAST operator, DetailAST variable)Checks if variable is in operator declaration.private booleanIllegalTypeCheck. isVerifiable(DetailAST methodOrVariableDef)Checks if current method's return type or variable's type is verifiable according to memberModifiers option.private static booleanExplicitInitializationCheck. isZero(DetailAST expr)Checks if given node contains numeric constant for zero.private static booleanExplicitInitializationCheck. isZeroChar(DetailAST exprStart)Examine char literal for initializing to default value.private voidReturnCountCheck. leave(DetailAST ast)Checks number of return statements and restore previous context.private voidModifiedControlVariableCheck. leaveForDef(DetailAST ast)Pops the variables from the stack.private voidModifiedControlVariableCheck. leaveForEach(DetailAST paramDef)Push current variables to the stack.private voidModifiedControlVariableCheck. leaveForIter(DetailAST ast)Push current variables to the stack.private voidEqualsAvoidNullCheck. leaveSlist(DetailAST ast)Determine whether SLIST begins static or non-static block.voidAbstractSuperCheck. leaveToken(DetailAST ast)voidDeclarationOrderCheck. leaveToken(DetailAST ast)voidEqualsAvoidNullCheck. leaveToken(DetailAST ast)voidFinalLocalVariableCheck. leaveToken(DetailAST ast)voidHiddenFieldCheck. leaveToken(DetailAST ast)voidModifiedControlVariableCheck. leaveToken(DetailAST ast)voidNestedForDepthCheck. leaveToken(DetailAST ast)voidNestedIfDepthCheck. leaveToken(DetailAST literalIf)voidNestedTryDepthCheck. leaveToken(DetailAST literalTry)voidOneStatementPerLineCheck. leaveToken(DetailAST ast)voidParameterAssignmentCheck. leaveToken(DetailAST ast)voidReturnCountCheck. leaveToken(DetailAST ast)voidUnnecessaryParenthesesCheck. leaveToken(DetailAST ast)private voidRequireThisCheck. logViolation(java.lang.String msgKey, DetailAST ast, RequireThisCheck.AbstractFrame frame)Helper method to log a LocalizedMessage.protected voidAbstractNestedDepthCheck. nestIn(DetailAST ast, java.lang.String messageId)Deprecated.Increasing current nesting depth.private voidIllegalInstantiationCheck. postProcessLiteralNew(DetailAST newTokenAst)Processes one of the collected "new" tokens when walking tree has finished.private voidIllegalInstantiationCheck. processClassDef(DetailAST ast)Collects classes defined in the source file.private voidDeclarationOrderCheck. processConstructor(DetailAST ast)Processes constructor.private voidEqualsAvoidNullCheck. 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 voidRequireThisCheck. processIdent(DetailAST ast)Checks if a given IDENT is method call or field name which requires explicitthisqualifier.private voidIllegalInstantiationCheck. processImport(DetailAST ast)Perform processing for an import token.private voidHiddenFieldCheck. processLambda(DetailAST ast)Process a lambda token.private voidEqualsAvoidNullCheck. processLiteralNew(DetailAST ast)Determine whether LITERAL_NEW is an anonymous class definition and add it as a frame in this case.private voidIllegalInstantiationCheck. processLiteralNew(DetailAST ast)Collects a "new" token.private voidEqualsAvoidNullCheck. processMethodCall(DetailAST methodCall)Add the method call to the current frame if it should be processed.private voidDeclarationOrderCheck. processModifiers(DetailAST ast)Processes modifiers.private booleanDeclarationOrderCheck. 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 voidDeclarationOrderCheck. 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 voidIllegalInstantiationCheck. processPackageDef(DetailAST ast)Perform processing for an package token.private voidEqualsAvoidNullCheck. processSlist(DetailAST ast)Determine whether SLIST begins static or non-static block and add it as a frame in this case.private voidHiddenFieldCheck. processVariable(DetailAST ast)Process a variable token.private voidFinalLocalVariableCheck. removeFinalVariableCandidateFromStack(DetailAST ast)Removes the final variable candidate from the Stack.private voidMagicNumberCheck. 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 booleanFinalLocalVariableCheck. shouldCheckEnhancedForLoopVariable(DetailAST ast)Determines whether enhanced for-loop variable should be checked or not.private static booleanFinalLocalVariableCheck. shouldRemoveFinalVariableCandidate(FinalLocalVariableCheck.ScopeData scopeData, DetailAST ast)Whether the final variable candidate should be removed from the list of final local variable candidates.private static booleanFinalLocalVariableCheck. shouldUpdateUninitializedVariables(DetailAST ast)If token is LITERAL_IF and there is anelsefollowing or token is CASE_GROUP and there is anothercasefollowing, then update the uninitialized variables.private static DetailASTEqualsAvoidNullCheck. skipVariableAssign(DetailAST currentAST)Skips over an inner assign portion of an argument expression.private voidExplicitInitializationCheck. validateNonObjects(DetailAST ast)Checks for explicit initializations made to 'false', '0' and '\0'.private voidParameterAssignmentCheck. visitAssign(DetailAST ast)Checks if this is assignments of parameter.private voidIllegalTypeCheck. 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 voidParameterAssignmentCheck. visitIncDec(DetailAST ast)Checks if this is increment/decrement of parameter.private voidIllegalTypeCheck. visitMethodDef(DetailAST methodDef)Checks return type of a given method.private voidParameterAssignmentCheck. visitMethodDef(DetailAST ast)Creates new set of parameters and store old one in stack.private voidReturnCountCheck. visitMethodDef(DetailAST ast)Creates new method context and places old one on the stack.private voidParameterAssignmentCheck. visitMethodParameters(DetailAST ast)Creates new parameter set for given method.private voidHiddenFieldCheck. visitOtherTokens(DetailAST ast, int type)Called to process tokens other thanTokenTypes.VARIABLE_DEFandTokenTypes.PARAMETER_DEF.private voidIllegalTypeCheck. visitParameterDef(DetailAST parameterDef)Checks type of parameters.private voidReturnCountCheck. visitReturn(DetailAST ast)Examines the return statement and tells context about it.voidAbstractIllegalMethodCheck. visitToken(DetailAST aAST)Deprecated.voidAbstractSuperCheck. visitToken(DetailAST ast)voidArrayTrailingCommaCheck. visitToken(DetailAST arrayInit)voidAvoidInlineConditionalsCheck. visitToken(DetailAST ast)voidCovariantEqualsCheck. visitToken(DetailAST ast)voidDeclarationOrderCheck. visitToken(DetailAST ast)voidDefaultComesLastCheck. visitToken(DetailAST ast)voidEmptyStatementCheck. visitToken(DetailAST ast)voidEqualsAvoidNullCheck. visitToken(DetailAST ast)voidEqualsHashCodeCheck. visitToken(DetailAST ast)voidExplicitInitializationCheck. visitToken(DetailAST ast)voidFallThroughCheck. visitToken(DetailAST ast)voidFinalLocalVariableCheck. visitToken(DetailAST ast)voidHiddenFieldCheck. visitToken(DetailAST ast)voidIllegalCatchCheck. visitToken(DetailAST detailAST)voidIllegalInstantiationCheck. visitToken(DetailAST ast)voidIllegalThrowsCheck. visitToken(DetailAST detailAST)voidIllegalTokenCheck. visitToken(DetailAST ast)voidIllegalTokenTextCheck. visitToken(DetailAST ast)voidIllegalTypeCheck. visitToken(DetailAST ast)voidInnerAssignmentCheck. visitToken(DetailAST ast)voidMagicNumberCheck. visitToken(DetailAST ast)voidMissingCtorCheck. visitToken(DetailAST ast)voidMissingSwitchDefaultCheck. visitToken(DetailAST ast)voidModifiedControlVariableCheck. visitToken(DetailAST ast)voidMultipleStringLiteralsCheck. visitToken(DetailAST ast)voidMultipleVariableDeclarationsCheck. visitToken(DetailAST ast)voidNestedForDepthCheck. visitToken(DetailAST ast)voidNestedIfDepthCheck. visitToken(DetailAST literalIf)voidNestedTryDepthCheck. visitToken(DetailAST literalTry)voidNoCloneCheck. visitToken(DetailAST aAST)voidNoFinalizerCheck. visitToken(DetailAST aAST)voidOneStatementPerLineCheck. visitToken(DetailAST ast)voidOverloadMethodsDeclarationOrderCheck. visitToken(DetailAST ast)voidPackageDeclarationCheck. visitToken(DetailAST ast)voidParameterAssignmentCheck. visitToken(DetailAST ast)voidRequireThisCheck. visitToken(DetailAST ast)voidReturnCountCheck. visitToken(DetailAST ast)voidSimplifyBooleanExpressionCheck. visitToken(DetailAST ast)voidSimplifyBooleanReturnCheck. visitToken(DetailAST ast)voidStringLiteralEqualityCheck. visitToken(DetailAST ast)voidUnnecessaryParenthesesCheck. visitToken(DetailAST ast)voidVariableDeclarationUsageDistanceCheck. visitToken(DetailAST ast)private voidIllegalTypeCheck. 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 booleanRequireThisCheck.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 booleanRequireThisCheck.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 voidFinalLocalVariableCheck. updateAllUninitializedVariables(java.util.Deque<DetailAST> prevScopeUnitializedVariableData)Update current scope data uninitialized variable according to the whole scope data.private voidFinalLocalVariableCheck. 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 DetailASTHideUtilityClassConstructorCheck.Details. astClass ast.Methods in com.puppycrawl.tools.checkstyle.checks.design that return DetailAST Modifier and Type Method Description private DetailASTVisibilityModifierCheck. 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 DetailASTVisibilityModifierCheck. getGenericTypeArgs(DetailAST type, boolean isCanonicalName)Returns generic type arguments token.private static DetailASTDesignForExtensionCheck. getNearestClassOrEnumDefinition(DetailAST ast)Returns CLASS_DEF or ENUM_DEF token which is the nearest to the given ast node.private static DetailASTVisibilityModifierCheck. 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 voidFinalClassCheck. beginTree(DetailAST rootAST)voidOneTopLevelClassCheck. beginTree(DetailAST rootAST)voidVisibilityModifierCheck. beginTree(DetailAST rootAst)private booleanDesignForExtensionCheck. canBeOverridden(DetailAST methodDef)Checks whether a method can be overridden.private static booleanDesignForExtensionCheck. canBeSubclassed(DetailAST classDef)Checks if the given class (given CLASS_DEF node) can be subclassed.private static java.lang.StringFinalClassCheck. extractQualifiedName(DetailAST classExtend)Get name of class(with qualified package if specified) in extend clause.private DetailASTVisibilityModifierCheck. 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.voidOneTopLevelClassCheck. finishTree(DetailAST rootAST)private static java.lang.StringDesignForExtensionCheck. getAnnotationName(DetailAST annotation)Gets the name of the annotation.private static java.lang.StringThrowsCountCheck. getAnnotationName(DetailAST annotation)Gets name of an annotation.private static java.lang.StringVisibilityModifierCheck. getCanonicalName(DetailAST type)Gets canonical type's name from givenTYPEnode.private static DetailASTVisibilityModifierCheck. 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 DetailASTDesignForExtensionCheck. getNearestClassOrEnumDefinition(DetailAST ast)Returns CLASS_DEF or ENUM_DEF token which is the nearest to the given ast node.private static DetailASTVisibilityModifierCheck. 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.StringFinalClassCheck. getQualifiedClassName(DetailAST classAst)Get qualified class name from given class Ast.private static java.lang.StringFinalClassCheck. 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.StringVisibilityModifierCheck. getTypeName(DetailAST type, boolean isCanonicalName)Gets the name of type from given astTYPEnode.private static java.lang.StringVisibilityModifierCheck. getVisibilityScope(DetailAST variableDef)Returns the visibility scope for the variable.private static booleanDesignForExtensionCheck. hasDefaultOrExplicitNonPrivateCtor(DetailAST classDef)Checks whether a class has default or explicit non-private constructor.private static booleanDesignForExtensionCheck. hasEmptyImplementation(DetailAST ast)Checks whether a method has only comments in the body (has an empty implementation).private booleanVisibilityModifierCheck. hasIgnoreAnnotation(DetailAST variableDef)Checks if variable def has ignore annotation.private static booleanDesignForExtensionCheck. hasIgnoredAnnotation(DetailAST methodDef, java.util.Set<java.lang.String> annotations)Checks whether a method has any of ignored annotations.private booleanDesignForExtensionCheck. hasJavadocComment(DetailAST methodDef)Checks whether a method has a javadoc comment.private booleanVisibilityModifierCheck. hasProperAccessModifier(DetailAST variableDef, java.lang.String variableName)Checks if current variable has proper access modifier according to Check's options.private static booleanHideUtilityClassConstructorCheck. isAbstract(DetailAST ast)Returns true if given class is abstract or false.private booleanVisibilityModifierCheck. isAllowedPublicField(DetailAST variableDef)Checks whether the variable satisfies the public field check.private static booleanVisibilityModifierCheck. isAnonymousClassVariable(DetailAST variableDef)Checks if current variable definition is definition of an anonymous class.private static booleanVisibilityModifierCheck. isCanonicalName(DetailAST type)Checks whether type definition is in canonical form.private booleanMutableExceptionCheck. isExtendedClassNamedAsException(DetailAST ast)Checks that if extended class name conforms to specified format.private static booleanVisibilityModifierCheck. isFinalField(DetailAST variableDef)Checks whether current field is final.private booleanVisibilityModifierCheck. 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 booleanVisibilityModifierCheck. isImmutableFieldDefinedInFinalClass(DetailAST variableDef)Checks whether immutable field is defined in final class.private static booleanThrowsCountCheck. isInPrivateMethod(DetailAST ast)Checks if method, which throws an exception is private.private booleanMutableExceptionCheck. isNamedAsException(DetailAST ast)Checks that a class name conforms to specified format.private booleanDesignForExtensionCheck. isNativeMethod(DetailAST ast)Checks whether a methods is native.private static booleanThrowsCountCheck. isOverriding(DetailAST ast)Check if a method has annotation @Override.private static booleanVisibilityModifierCheck. isPrimitive(DetailAST type)Checks if current type is primitive type (int, short, float, boolean, double, etc.).private static booleanOneTopLevelClassCheck. isPublic(DetailAST typeDef)Checks if a type is public.private static booleanVisibilityModifierCheck. isStarImport(DetailAST importAst)Checks if current import is star import.private static booleanHideUtilityClassConstructorCheck. isStatic(DetailAST ast)Returns true if given class is static or false.private static booleanVisibilityModifierCheck. isStaticFinalVariable(DetailAST variableDef)Checks whether variable has static final modifiers.voidFinalClassCheck. leaveToken(DetailAST ast)voidInnerTypeLastCheck. leaveToken(DetailAST ast)voidMutableExceptionCheck. leaveToken(DetailAST ast)private voidFinalClassCheck. registerNestedSubclassToOuterSuperClasses(DetailAST classAst)Register to outer super classes of given classAst that given classAst is extending them.private voidMutableExceptionCheck. visitClassDef(DetailAST ast)Called when we start processing class definition.private voidVisibilityModifierCheck. visitImport(DetailAST importAst)Checks imported type.private voidThrowsCountCheck. visitLiteralThrows(DetailAST ast)Checks number of throws statements.voidDesignForExtensionCheck. visitToken(DetailAST ast)voidFinalClassCheck. visitToken(DetailAST ast)voidHideUtilityClassConstructorCheck. visitToken(DetailAST ast)voidInnerTypeLastCheck. visitToken(DetailAST ast)voidInterfaceIsTypeCheck. visitToken(DetailAST ast)voidMutableExceptionCheck. visitToken(DetailAST ast)voidThrowsCountCheck. visitToken(DetailAST ast)voidVisibilityModifierCheck. visitToken(DetailAST ast)private voidMutableExceptionCheck. visitVariableDef(DetailAST ast)Checks variable definition.private voidVisibilityModifierCheck. 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 voidCustomImportOrderCheck. beginTree(DetailAST rootAST)voidImportControlCheck. beginTree(DetailAST rootAST)voidImportOrderCheck. beginTree(DetailAST rootAST)voidRedundantImportCheck. beginTree(DetailAST aRootAST)voidUnusedImportsCheck. beginTree(DetailAST rootAST)private voidUnusedImportsCheck. collectReferencesFromJavadoc(DetailAST ast)Collects references made in Javadoc comments.private static java.lang.StringCustomImportOrderCheck. createSamePackageRegexp(int firstPackageDomainsCount, DetailAST packageNode)Creates samePackageDomainsRegExp of the first package domains.voidCustomImportOrderCheck. finishTree(DetailAST rootAST)voidUnusedImportsCheck. finishTree(DetailAST rootAST)private static java.lang.StringCustomImportOrderCheck. getFullImportIdent(DetailAST token)Forms import full path.private static java.lang.StringImportControlCheck. getImportText(DetailAST ast)Returns import text.private static java.lang.StringImportControlCheck. getPackageText(DetailAST ast)Returns package text.private voidAvoidStarImportCheck. logsStarredImportViolation(DetailAST startingDot)Gets the full import identifier.private voidUnusedImportsCheck. processIdent(DetailAST ast)Collects references made by IDENT.private voidUnusedImportsCheck. processImport(DetailAST ast)Collects the details of imports.private voidUnusedImportsCheck. processStaticImport(DetailAST ast)Collects the details of static imports.voidAvoidStarImportCheck. visitToken(DetailAST ast)voidAvoidStaticImportCheck. visitToken(DetailAST ast)voidCustomImportOrderCheck. visitToken(DetailAST ast)voidIllegalImportCheck. visitToken(DetailAST ast)voidImportControlCheck. visitToken(DetailAST ast)voidImportOrderCheck. visitToken(DetailAST ast)voidRedundantImportCheck. visitToken(DetailAST ast)voidUnusedImportsCheck. 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 DetailASTAbstractExpressionHandler. mainAstThe 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. createdHandlersCache for created method call handlers.Methods in com.puppycrawl.tools.checkstyle.checks.indentation that return DetailAST Modifier and Type Method Description private DetailASTCommentsIndentationCheck. findPreviousStatement(DetailAST comment, DetailAST root)Finds a previous statement of the comment.private static DetailASTCommentsIndentationCheck. findStartTokenOfMethodCallChain(DetailAST root)Finds the start token of method call chain.private static DetailASTCommentsIndentationCheck. findTokenWhichBeginsTheLine(DetailAST root)Finds a token which begins the line.private static DetailASTCommentsIndentationCheck. getDistributedPreviousStatement(DetailAST comment)Returns the first token of the distributed previous statement of comment.private static DetailASTMethodCallHandler. getFirstAst(DetailAST ast)Get the first AST of the specified method call.static DetailASTAbstractExpressionHandler. 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 DetailASTForHandler. getForLoopRightParen(DetailAST literalForAst)Returns right parenthesis of for-loop statement.private static DetailASTIfHandler. getIfStatementRightParen(DetailAST literalIfAst)Returns right parenthesis of if statement.protected DetailASTArrayInitHandler. getLeftCurly()protected DetailASTBlockParentHandler. getLeftCurly()Get the left curly brace portion of the expression we are handling.protected DetailASTClassDefHandler. getLeftCurly()protected DetailASTObjectBlockHandler. getLeftCurly()protected DetailASTSlistHandler. getLeftCurly()protected DetailASTSwitchHandler. getLeftCurly()protected DetailASTBlockParentHandler. getLeftParen()Get the left parenthesis portion of the expression we are handling.protected DetailASTArrayInitHandler. getListChild()protected DetailASTBlockParentHandler. getListChild()Get the child element representing the list of statements.protected DetailASTClassDefHandler. getListChild()protected DetailASTObjectBlockHandler. getListChild()protected DetailASTSlistHandler. getListChild()protected DetailASTSwitchHandler. getListChild()protected DetailASTAbstractExpressionHandler. getMainAst()Accessor for the MainAst attribute.private static DetailASTMethodCallHandler. getMethodCallLastNode(DetailAST firstNode)Returns method call right paren.private static DetailASTMethodDefHandler. getMethodDefParamRightParen(DetailAST methodDefAst)Returns right parenthesis of method definition parameter list.private static DetailASTLineWrappingHandler. getNextCurNode(DetailAST curNode)Returns next curNode node.private static DetailASTCommentsIndentationCheck. getNextStmt(DetailAST comment)Returns the next statement of a comment.private DetailASTCommentsIndentationCheck. getNextToken(DetailAST checkedStatement)Get the token to start counting the number of lines to add to the distance aim from.protected DetailASTBlockParentHandler. getNonListChild()Get the child element that is not a list of statements.protected DetailASTElseHandler. getNonListChild()protected DetailASTSwitchHandler. getNonListChild()private DetailASTCommentsIndentationCheck. getOneLinePreviousStatement(DetailAST comment)Does pre-order traverse of abstract syntax tree to find the previous statement of the comment.private static DetailASTCommentsIndentationCheck. getPrevCaseToken(DetailAST parentStatement)Gets previous case-token for comment.private DetailASTCommentsIndentationCheck. getPreviousStatement(DetailAST comment)Returns the previous statement of a comment.private static DetailASTCommentsIndentationCheck. getPrevStatementFromSwitchBlock(DetailAST comment)Gets comment's previous statement from switch block.private static DetailASTCommentsIndentationCheck. getPrevStatementWhenCommentIsUnderCase(DetailAST parentStatement)Gets previous statement for comment which is placed immediately under case.protected DetailASTArrayInitHandler. getRightCurly()protected DetailASTBlockParentHandler. getRightCurly()Get the right curly brace portion of the expression we are handling.protected DetailASTClassDefHandler. getRightCurly()protected DetailASTObjectBlockHandler. getRightCurly()protected DetailASTSlistHandler. getRightCurly()protected DetailASTSwitchHandler. getRightCurly()protected DetailASTBlockParentHandler. getRightParen()Get the right parenthesis portion of the expression we are handling.private static DetailASTSynchronizedHandler. getSynchronizedStatementRightParen(DetailAST syncStatementAST)Returns right parenthesis of synchronized statement.protected DetailASTArrayInitHandler. getTopLevelAst()protected DetailASTBlockParentHandler. getTopLevelAst()Get the top level expression being managed by this handler.protected DetailASTClassDefHandler. getTopLevelAst()protected DetailASTMethodDefHandler. getTopLevelAst()protected DetailASTObjectBlockHandler. getTopLevelAst()protected DetailASTSlistHandler. getTopLevelAst()private static DetailASTMemberDefHandler. 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 booleanMethodCallHandler. areMethodsChained(DetailAST ast1, DetailAST ast2)Checks if ast2 is a chained method call that starts on the same level as ast1 ends.static booleanAbstractExpressionHandler. areOnSameLine(DetailAST ast1, DetailAST ast2)Determines if two expressions are on the same line.private booleanCommentsIndentationCheck. 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.:voidIndentationCheck. beginTree(DetailAST ast)private voidLineWrappingHandler. checkAnnotationIndentation(DetailAST atNode, java.util.NavigableMap<java.lang.Integer,DetailAST> firstNodesOnLines, int indentLevel)Checks line wrapping into annotations.protected voidAbstractExpressionHandler. checkChildren(DetailAST parentNode, int[] tokenTypes, IndentLevel startIndent, boolean firstLineMatches, boolean allowNesting)Check the indent level of the children of the specified parent expression.protected voidAbstractExpressionHandler. checkExpressionSubtree(DetailAST tree, IndentLevel indentLevel, boolean firstLineMatches, boolean allowNesting)Check the indentation level for an expression subtree.voidLineWrappingHandler. checkIndentation(DetailAST firstNode, DetailAST lastNode)Checks line wrapping into expressions and definitions using property 'lineWrappingIndentation'.voidLineWrappingHandler. checkIndentation(DetailAST firstNode, DetailAST lastNode, int indentLevel)Checks line wrapping into expressions and definitions.voidLineWrappingHandler. checkIndentation(DetailAST firstNode, DetailAST lastNode, int indentLevel, int startIndent, boolean ignoreFirstLine)Checks line wrapping into expressions and definitions.protected voidAbstractExpressionHandler. checkLeftParen(DetailAST lparen)Check the indentation of the left parenthesis.protected voidAbstractExpressionHandler. checkRightParen(DetailAST lparen, DetailAST rparen)Check the indentation of the right parenthesis.protected voidAbstractExpressionHandler. checkWrappingIndentation(DetailAST firstNode, DetailAST lastNode)Checks indentation on wrapped lines between and includingfirstNodeandlastNode.protected voidAbstractExpressionHandler. checkWrappingIndentation(DetailAST firstNode, DetailAST lastNode, int wrappedIndentLevel, int startIndent, boolean ignoreFirstLine)Checks indentation on wrapped lines between and includingfirstNodeandlastNode.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 intCommentsIndentationCheck. countEmptyLines(DetailAST startStatement, DetailAST endStatement)Count the number of empty lines between statements.private AbstractExpressionHandlerHandlerFactory. createMethodCallHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)Create new instance of handler for METHOD_CALL.protected intAbstractExpressionHandler. expandedTabsColumnNo(DetailAST ast)Get the column number for the start of a given expression, expanding tabs out into spaces in the process.private intLineWrappingHandler. expandedTabsColumnNo(DetailAST ast)Get the column number for the start of a given expression, expanding tabs out into spaces in the process.private DetailASTCommentsIndentationCheck. findPreviousStatement(DetailAST comment, DetailAST root)Finds a previous statement of the comment.private static DetailASTCommentsIndentationCheck. findStartTokenOfMethodCallChain(DetailAST root)Finds the start token of method call chain.protected voidAbstractExpressionHandler. findSubtreeLines(LineSet lines, DetailAST tree, boolean allowNesting)Find the set of lines for a given subtree.private static DetailASTCommentsIndentationCheck. findTokenWhichBeginsTheLine(DetailAST root)Finds a token which begins the line.private static DetailASTCommentsIndentationCheck. getDistributedPreviousStatement(DetailAST comment)Returns the first token of the distributed previous statement of comment.private static DetailASTMethodCallHandler. getFirstAst(DetailAST ast)Get the first AST of the specified method call.protected intAbstractExpressionHandler. getFirstLine(int startLine, DetailAST tree)Get the first line for a given expression.static DetailASTAbstractExpressionHandler. 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 DetailASTForHandler. getForLoopRightParen(DetailAST literalForAst)Returns right parenthesis of for-loop statement.AbstractExpressionHandlerHandlerFactory. getHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)Get the handler for an AST.private static java.lang.StringClassDefHandler. getHandlerName(DetailAST ast)Creates a handler name for this class according to ast type.private static java.lang.StringMethodDefHandler. getHandlerName(DetailAST ast)Creates a handler name for this class according to ast type.private static DetailASTIfHandler. getIfStatementRightParen(DetailAST literalIfAst)Returns right parenthesis of if statement.protected intAbstractExpressionHandler. getLineStart(DetailAST ast)Get the start of the line for the given expression.private intLineWrappingHandler. getLineStart(DetailAST ast)Get the start of the line for the given expression.private static java.lang.StringCommentsIndentationCheck. getMessageKey(DetailAST comment)Get a message key depending on a comment type.private static DetailASTMethodCallHandler. getMethodCallLastNode(DetailAST firstNode)Returns method call right paren.private intMethodDefHandler. getMethodDefLineStart(DetailAST mainAst)Gets the start line of the method, excluding any annotations.private static DetailASTMethodDefHandler. getMethodDefParamRightParen(DetailAST methodDefAst)Returns right parenthesis of method definition parameter list.private static DetailASTLineWrappingHandler. getNextCurNode(DetailAST curNode)Returns next curNode node.private static java.lang.IntegerLineWrappingHandler. 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 DetailASTCommentsIndentationCheck. getNextStmt(DetailAST comment)Returns the next statement of a comment.private DetailASTCommentsIndentationCheck. getNextToken(DetailAST checkedStatement)Get the token to start counting the number of lines to add to the distance aim from.private DetailASTCommentsIndentationCheck. getOneLinePreviousStatement(DetailAST comment)Does pre-order traverse of abstract syntax tree to find the previous statement of the comment.private static DetailASTCommentsIndentationCheck. getPrevCaseToken(DetailAST parentStatement)Gets previous case-token for comment.private DetailASTCommentsIndentationCheck. getPreviousStatement(DetailAST comment)Returns the previous statement of a comment.private static DetailASTCommentsIndentationCheck. getPrevStatementFromSwitchBlock(DetailAST comment)Gets comment's previous statement from switch block.private static DetailASTCommentsIndentationCheck. getPrevStatementWhenCommentIsUnderCase(DetailAST parentStatement)Gets previous statement for comment which is placed immediately under case.private static DetailASTSynchronizedHandler. getSynchronizedStatementRightParen(DetailAST syncStatementAST)Returns right parenthesis of synchronized statement.private static DetailASTMemberDefHandler. getVarDefStatementSemicolon(DetailAST variableDef)Returns semicolon for variable definition statement.private voidCommentsIndentationCheck. handleCommentAtTheEndOfTheCodeBlock(DetailAST prevStmt, DetailAST comment, DetailAST nextStmt)Handles a comment which is placed at the end of non empty code block.private voidCommentsIndentationCheck. handleCommentInEmptyCaseBlock(DetailAST prevStmt, DetailAST comment, DetailAST nextStmt)Handles a comment which is placed within empty case block.private voidCommentsIndentationCheck. handleCommentInEmptyCodeBlock(DetailAST comment, DetailAST nextStmt)Handles a comment which is placed within the empty code block.private voidCommentsIndentationCheck. handleFallThroughComment(DetailAST prevStmt, DetailAST comment, DetailAST nextStmt)Handles 'fall through' single line comment.private static booleanMemberDefHandler. isArrayDeclaration(DetailAST variableDef)Checks if variable_def node is array declaration.private static booleanCommentsIndentationCheck. isBlockStart(DetailAST root)Whether the AST node starts a block.private static booleanCommentsIndentationCheck. isComment(DetailAST ast)Whether the ast is a comment.private static booleanCommentsIndentationCheck. isCommentAtTheEndOfTheCodeBlock(DetailAST nextStmt)Checks whether a comment is placed at the end of the code block.private static booleanCommentsIndentationCheck. isCommentForMultiblock(DetailAST endBlockStmt)Whether the comment might have been used for the next block in a multi-block structure.private static booleanCommentsIndentationCheck. isDefinition(DetailAST previousSibling)Whether the statement is a kind of definition (method, class etc.).private booleanCommentsIndentationCheck. 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 booleanCommentsIndentationCheck. isDistributedPreviousStatement(DetailAST comment)Checks whether the previous statement of a comment is distributed over two or more lines.private static booleanCommentsIndentationCheck. isDistributedReturnStatement(DetailAST commentPreviousSibling)Checks whether the previous statement of a comment is a distributed return statement.private static booleanCommentsIndentationCheck. isDistributedThrowStatement(DetailAST commentPreviousSibling)Checks whether the previous statement of a comment is a distributed throw statement.private booleanLineWrappingHandler. isEndOfScope(DetailAST lastAnnotationNode, DetailAST node)Checks line for end of scope.private static booleanCommentsIndentationCheck. isFallThroughComment(DetailAST prevStmt, DetailAST nextStmt)Checks whether comment is a 'fall through' comment.private static booleanCommentsIndentationCheck. isInEmptyCaseBlock(DetailAST prevStmt, DetailAST nextStmt)Checks whether case block is empty.private static booleanCommentsIndentationCheck. isInEmptyCodeBlock(DetailAST prevStmt, DetailAST nextStmt)Checks whether comment is placed in the empty code block.private static booleanSynchronizedHandler. isMethodModifier(DetailAST ast)Checks if given synchronized is modifier of method.private booleanCommentsIndentationCheck. 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 booleanAbstractExpressionHandler. isOnStartOfLine(DetailAST ast)Determines if the given expression is at the start of a line.private static booleanCommentsIndentationCheck. isStatementWithPossibleCurlies(DetailAST previousSibling)Whether the statement can have or always have curly brackets.private booleanCommentsIndentationCheck. isTrailingBlockComment(DetailAST blockComment)Checks if current comment block is trailing comment, e.g.:private booleanCommentsIndentationCheck. isTrailingComment(DetailAST comment)Checks if current comment is a trailing comment.private booleanCommentsIndentationCheck. isTrailingSingleLineComment(DetailAST singleLineComment)Checks if current single line comment is trailing comment, e.g.:private static booleanCommentsIndentationCheck. isUsingOfObjectReferenceToInvokeMethod(DetailAST root)Checks whether there is a use of an object reference to invoke an object's method on line.voidIndentationCheck. leaveToken(DetailAST ast)protected voidAbstractExpressionHandler. logError(DetailAST ast, java.lang.String subtypeName, int actualIndent)Log an indentation error.protected voidAbstractExpressionHandler. logError(DetailAST ast, java.lang.String subtypeName, int actualIndent, IndentLevel expectedIndent)Log an indentation error.private voidCommentsIndentationCheck. logMultilineIndentation(DetailAST prevStmt, DetailAST comment, DetailAST nextStmt)Logs comment which can have the same indentation level as next or previous statement.private voidLineWrappingHandler. logWarningMessage(DetailAST currentNode, int currentIndent)Logs warning message if indentation is incorrect.private voidCommentsIndentationCheck. visitComment(DetailAST comment)Checks comment indentations over surrounding code, e.g.:voidCommentsIndentationCheck. visitToken(DetailAST commentAst)voidIndentationCheck. visitToken(DetailAST ast)Method parameters in com.puppycrawl.tools.checkstyle.checks.indentation with type arguments of type DetailAST Modifier and Type Method Description private voidLineWrappingHandler. checkAnnotationIndentation(DetailAST atNode, java.util.NavigableMap<java.lang.Integer,DetailAST> firstNodesOnLines, int indentLevel)Checks line wrapping into annotations.private static java.lang.IntegerLineWrappingHandler. 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 DetailASTAbstractJavadocCheck. blockCommentAstDetailAST 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 DetailASTAbstractJavadocCheck. 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 voidAbstractJavadocCheck. beginTree(DetailAST rootAST)private static ScopeJavadocMethodCheck. calculateScope(DetailAST ast)Returns the scope for the method/constructor at the specified AST.private voidJavadocMethodCheck. checkComment(DetailAST ast, TextBlock comment)Checks the Javadoc for a method.private voidJavadocStyleCheck. checkComment(DetailAST ast, TextBlock comment)Performs the various checks against the Javadoc comment.private voidJavadocStyleCheck. checkFirstSentenceEnding(DetailAST ast, TextBlock comment)Checks that the first sentence ends with proper punctuation.private voidJavadocStyleCheck. 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 voidJavadocMethodCheck. checkParamTags(java.util.List<JavadocTag> tags, DetailAST parent, boolean reportExpectedTags)Checks a set of tags for matching parameters.voidAbstractJavadocCheck. finishTree(DetailAST rootAST)private static intJavadocMethodCheck. getMethodsNumberOfLine(DetailAST methodDef)Some javadoc.private static java.util.List<DetailAST>JavadocMethodCheck. getParameters(DetailAST ast)Computes the parameter nodes for a method.private static intAtclauseOrderCheck. 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 booleanJavadocMethodCheck. hasAllowedAnnotations(DetailAST methodDef)Some javadoc.private booleanJavadocMethodCheck. hasShortCircuitTag(DetailAST ast, java.util.List<JavadocTag> tags)Validates whether the Javadoc has a short circuit tag.private booleanJavadocMethodCheck. 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 booleanJavadocVariableCheck. isIgnored(DetailAST ast)Decides whether the variable name of an AST is in the ignore list.protected booleanJavadocMethodCheck. isMissingJavadocAllowed(DetailAST ast)The JavadocMethodCheck is about to report a missing Javadoc.private static booleanSingleLineJavadocCheck. isSingleLineJavadoc(DetailAST blockCommentStart)Checks if comment is single line comment.abstract booleanJavadocTagInfo. isValidOn(DetailAST ast)Checks if a particular Javadoc tag is valid within a Javadoc block of a given AST.private booleanJavadocMethodCheck. matchesSkipRegex(DetailAST methodDef)Checks if the given method name matches the regex.protected voidJavadocMethodCheck. processAST(DetailAST ast)private booleanJavadocMethodCheck. shouldCheck(DetailAST ast, Scope nodeScope)Whether we should check this node.private booleanJavadocStyleCheck. shouldCheck(DetailAST ast)Whether we should check this node.private booleanJavadocTypeCheck. shouldCheck(DetailAST ast)Whether we should check this node.private booleanJavadocVariableCheck. shouldCheck(DetailAST ast)Whether we should check this node.voidAbstractJavadocCheck. visitToken(DetailAST blockCommentNode)voidJavadocStyleCheck. visitToken(DetailAST ast)voidJavadocTypeCheck. visitToken(DetailAST ast)voidJavadocVariableCheck. visitToken(DetailAST ast)voidWriteTagCheck. 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 booleanJavadocMethodCheck. removeMatchingParam(java.util.List<DetailAST> params, java.lang.String paramName)Remove parameter from params collection by name.private static booleanJavadocMethodCheck. 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 DetailASTNPathComplexityCheck. 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 voidAbstractClassCouplingCheck.ClassContext. addReferencedClassName(DetailAST ast)Adds new referenced class.voidAbstractClassCouplingCheck. beginTree(DetailAST ast)voidJavaNCSSCheck. beginTree(DetailAST rootAST)voidNPathComplexityCheck. beginTree(DetailAST rootAST)voidBooleanExpressionComplexityCheck.Context. checkCount(DetailAST ast)Checks if we violates maximum allowed complexity.private static intNPathComplexityCheck. countCaseTokens(DetailAST ast)Counts number of case tokens subject to a case group token.private static intNPathComplexityCheck. countConditionalOperators(DetailAST ast)Calculates number of conditional operators, including inline ternary operatior, for a token.voidJavaNCSSCheck. finishTree(DetailAST rootAST)private static DetailASTNPathComplexityCheck. getLastToken(DetailAST ast)Finds a leaf, which is the most distant from the root.booleanNPathComplexityCheck.TokenEnd. isAfter(DetailAST ast)Checks if saved coordinates located after given token.private static booleanJavaNCSSCheck. isCountable(DetailAST ast)Checks if a token is countable for the ncss metric.private static booleanJavaNCSSCheck. isExpressionCountable(DetailAST ast)Checks if an expression is countable for the ncss metric.private static booleanBooleanExpressionComplexityCheck. isPassedInParameter(DetailAST logicalOperator)Checks if logical operator is part of constructor or method call.private static booleanBooleanExpressionComplexityCheck. isPipeOperator(DetailAST binaryOr)Checks ifbinary ORis applied to exceptions in multi-catch (pipe-syntax).private static booleanJavaNCSSCheck. isVariableDefCountable(DetailAST ast)Checks if a variable definition is countable.private voidBooleanExpressionComplexityCheck. leaveExpr(DetailAST ast)Restores previous context.private voidAbstractComplexityCheck. leaveMethodDef(DetailAST ast)Deprecated.Process the end of a method definition.private voidCyclomaticComplexityCheck. leaveMethodDef(DetailAST ast)Process the end of a method definition.private voidNPathComplexityCheck. leaveMethodDef(DetailAST ast)Process the end of a method definition.voidAbstractClassCouplingCheck. leaveToken(DetailAST ast)voidAbstractComplexityCheck. leaveToken(DetailAST ast)Deprecated.voidBooleanExpressionComplexityCheck. leaveToken(DetailAST ast)voidCyclomaticComplexityCheck. leaveToken(DetailAST ast)voidJavaNCSSCheck. leaveToken(DetailAST ast)voidNPathComplexityCheck. leaveToken(DetailAST ast)protected abstract voidAbstractComplexityCheck. leaveTokenHook(DetailAST ast)Deprecated.Hook called when leaving a token.voidAbstractClassCouplingCheck.FileContext. registerImport(DetailAST imp)Registers given import.voidNPathComplexityCheck.TokenEnd. setToken(DetailAST endToken)Sets end coordinates from given token.private voidAbstractClassCouplingCheck. visitClassDef(DetailAST classDef)Creates new context for a given class.private voidNPathComplexityCheck. 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.voidAbstractClassCouplingCheck.ClassContext. visitLiteralNew(DetailAST ast)Visits NEW.voidAbstractClassCouplingCheck.FileContext. visitLiteralNew(DetailAST ast)Visits NEW token for the current class context.voidAbstractClassCouplingCheck.ClassContext. visitLiteralThrows(DetailAST literalThrows)Visits throws clause and collects all exceptions we throw.voidAbstractClassCouplingCheck.FileContext. visitLiteralThrows(DetailAST ast)Visits THROWS token for the current class context.private voidBooleanExpressionComplexityCheck. visitMethodDef(DetailAST ast)Creates new context for a given method.private voidAbstractClassCouplingCheck. visitPackageDef(DetailAST pkg)Stores package of current class we check.voidAbstractClassCouplingCheck. visitToken(DetailAST ast)voidAbstractComplexityCheck. visitToken(DetailAST ast)Deprecated.voidBooleanExpressionComplexityCheck. visitToken(DetailAST ast)voidCyclomaticComplexityCheck. visitToken(DetailAST ast)voidJavaNCSSCheck. visitToken(DetailAST ast)voidNPathComplexityCheck. visitToken(DetailAST ast)protected abstract voidAbstractComplexityCheck. visitTokenHook(DetailAST ast)Deprecated.Hook called when visiting a token.protected voidCyclomaticComplexityCheck. visitTokenHook(DetailAST ast)Hook called when visiting a token.voidAbstractClassCouplingCheck.ClassContext. visitType(DetailAST ast)Visits type.voidAbstractClassCouplingCheck.FileContext. visitType(DetailAST ast)Visits type token for the current class context.private voidNPathComplexityCheck. 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 DetailASTModifierOrderCheck. checkOrderSuggestedByJls(java.util.List<DetailAST> modifiers)Checks if the modifiers were added in the order suggested in the Java language specification.private static DetailASTModifierOrderCheck. 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 voidRedundantModifierCheck. checkClassConstructorModifiers(DetailAST classCtorAst)Check if class constructor has proper modifiers.private voidRedundantModifierCheck. checkEnumConstructorModifiers(DetailAST ast)Check if enum constructor has proper modifiers.private voidRedundantModifierCheck. checkEnumDef(DetailAST ast)Checks whether enum has proper modifiers.private voidRedundantModifierCheck. checkForRedundantModifier(DetailAST ast, int modifierType)Checks if given ast has a redundant modifier.private voidRedundantModifierCheck. 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 booleanRedundantModifierCheck. isAnnotatedWithSafeVarargs(DetailAST methodDef)Checks if method definition is annotated with.private static booleanModifierOrderCheck. isAnnotationOnType(DetailAST modifier)Checks whether annotation on type takes place.private static booleanRedundantModifierCheck. isClassProtected(DetailAST classDef)Checks if given class ast has protected modifier.private static booleanRedundantModifierCheck. isClassPublic(DetailAST ast)Checks if given class is accessible from "public" scope.private static booleanRedundantModifierCheck. isEnumMember(DetailAST ast)Checks if current AST node is member of Enum.private static booleanRedundantModifierCheck. isInterfaceOrAnnotationMember(DetailAST ast)Checks if current AST node is member of Interface or Annotation, not of their subnodes.private voidRedundantModifierCheck. processAbstractMethodParameters(DetailAST ast)Process validation of parameters for Methods with no definition.private voidRedundantModifierCheck. processInterfaceOrAnnotation(DetailAST ast)Do validation of interface of annotation.private voidRedundantModifierCheck. processMethods(DetailAST ast)Process validation of Methods.private voidRedundantModifierCheck. processResources(DetailAST ast)Checks if given resource has redundant modifiers.voidModifierOrderCheck. visitToken(DetailAST ast)voidRedundantModifierCheck. 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 DetailASTModifierOrderCheck. checkOrderSuggestedByJls(java.util.List<DetailAST> modifiers)Checks if the modifiers were added in the order suggested in the Java language specification.private static DetailASTModifierOrderCheck. 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 AccessModifierParameterNameCheck. 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 booleanAbbreviationAsWordInNameCheck. hasOverrideAnnotation(DetailAST methodModifiersAST)Checks that the method has "@Override" annotation.private static booleanAbstractClassNameCheck. isAbstract(DetailAST ast)Checks if declared class is abstract or not.private static booleanLocalVariableNameCheck. isForLoopVariable(DetailAST variableDef)Checks if a variable is the loop's one.private booleanAbbreviationAsWordInNameCheck. isIgnoreSituation(DetailAST ast)Checks if it is an ignore situation.private static booleanAbbreviationAsWordInNameCheck. isInterfaceDeclaration(DetailAST variableDefAst)Check that variable definition in interface or @interface definition.private static booleanParameterNameCheck. isOverriddenMethod(DetailAST ast)Checks whether a method is annotated with Override annotation.protected booleanAbstractAccessControlNameCheck. mustCheckName(DetailAST ast)protected abstract booleanAbstractNameCheck. mustCheckName(DetailAST ast)Decides whether the name of an AST should be checked against the format regexp.protected booleanAbstractTypeParameterNameCheck. mustCheckName(DetailAST ast)Deprecated.protected booleanCatchParameterNameCheck. mustCheckName(DetailAST ast)protected booleanClassTypeParameterNameCheck. mustCheckName(DetailAST ast)protected booleanConstantNameCheck. mustCheckName(DetailAST ast)protected booleanInterfaceTypeParameterNameCheck. mustCheckName(DetailAST ast)protected booleanLocalFinalVariableNameCheck. mustCheckName(DetailAST ast)protected booleanLocalVariableNameCheck. mustCheckName(DetailAST ast)protected booleanMemberNameCheck. mustCheckName(DetailAST ast)protected booleanMethodTypeParameterNameCheck. mustCheckName(DetailAST ast)protected booleanParameterNameCheck. mustCheckName(DetailAST ast)protected booleanStaticVariableNameCheck. mustCheckName(DetailAST ast)protected booleanAbstractAccessControlNameCheck. shouldCheckInScope(DetailAST modifiers)Should we check member with given modifiers.private voidAbstractClassNameCheck. visitClassDef(DetailAST ast)Checks class definition.voidAbbreviationAsWordInNameCheck. visitToken(DetailAST ast)voidAbstractClassNameCheck. visitToken(DetailAST ast)voidAbstractNameCheck. visitToken(DetailAST ast)voidMethodNameCheck. visitToken(DetailAST ast)voidPackageNameCheck. 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 voidRegexpCheck. beginTree(DetailAST rootAST)voidRegexpSinglelineJavaCheck. 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 DetailASTExecutableStatementCountCheck.Context. astMember AST node.Methods in com.puppycrawl.tools.checkstyle.checks.sizes that return DetailAST Modifier and Type Method Description DetailASTExecutableStatementCountCheck.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 voidExecutableStatementCountCheck. beginTree(DetailAST rootAST)voidLineLengthCheck. beginTree(DetailAST rootAST)voidOuterTypeNumberCheck. beginTree(DetailAST ast)private voidMethodCountCheck. checkCounters(MethodCountCheck.MethodCounter counter, DetailAST ast)Check the counters and report violations.private voidMethodCountCheck. checkMax(int max, int value, java.lang.String msg, DetailAST ast)Utility for reporting if a maximum has been exceeded.voidOuterTypeNumberCheck. finishTree(DetailAST ast)private intMethodLengthCheck. getLengthOfBlock(DetailAST openingBrace, DetailAST closingBrace)Returns length of code only without comments and blank lines.private voidExecutableStatementCountCheck. leaveMemberDef(DetailAST ast)Process the end of a member definition.voidExecutableStatementCountCheck. leaveToken(DetailAST ast)voidMethodCountCheck. leaveToken(DetailAST ast)voidOuterTypeNumberCheck. leaveToken(DetailAST ast)private voidMethodCountCheck. raiseCounter(DetailAST method)Determine the visibility modifier and raise the corresponding counter.private booleanParameterNumberCheck. shouldIgnoreNumberOfParameters(DetailAST ast)Determine whether to ignore number of parameters for the method.private voidExecutableStatementCountCheck. visitMemberDef(DetailAST ast)Process the start of the member definition.private voidExecutableStatementCountCheck. visitSlist(DetailAST ast)Process the end of a statement list.voidAnonInnerLengthCheck. visitToken(DetailAST ast)voidExecutableStatementCountCheck. visitToken(DetailAST ast)voidMethodCountCheck. visitToken(DetailAST ast)voidMethodLengthCheck. visitToken(DetailAST ast)voidOuterTypeNumberCheck. visitToken(DetailAST ast)voidParameterNumberCheck. 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 DetailASTNoWhitespaceAfterCheck. getArrayDeclaratorPreviousElement(DetailAST ast)Returns proper argument for getPositionAfter method, it is a token afterARRAY_DECLARATOR, in can beRBRACK,IDENTor an array type definition (literal).private static DetailASTNoWhitespaceAfterCheck. getFirstNonArrayDeclaratorParent(DetailAST ast)Get node that ownsARRAY_DECLARATORsequence.private static DetailASTNoWhitespaceAfterCheck. getIdentLastToken(DetailAST ast)Gets leftmost token of identifier.private static DetailASTNoWhitespaceAfterCheck. getIndexOpPreviousElement(DetailAST ast)Gets previous node forINDEX_OPtoken for usage in getPositionAfter method, it is a simplified copy of getArrayDeclaratorPreviousElement method.private static DetailASTNoWhitespaceAfterCheck. getPreviousNodeWithParentOfTypeAst(DetailAST ast, DetailAST parent)Finds previous node by text order for an array declarator, which parent type isTYPE.private static DetailASTNoWhitespaceAfterCheck. getTypeLastNode(DetailAST ast)Searches parameter node for a type node.private static DetailASTNoWhitespaceAfterCheck. 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 voidGenericWhitespaceCheck. beginTree(DetailAST rootAST)voidSingleSpaceSeparatorCheck. beginTree(DetailAST rootAST)private static DetailASTNoWhitespaceAfterCheck. getArrayDeclaratorPreviousElement(DetailAST ast)Returns proper argument for getPositionAfter method, it is a token afterARRAY_DECLARATOR, in can beRBRACK,IDENTor an array type definition (literal).private java.util.List<java.lang.Integer>EmptyLineSeparatorCheck. getEmptyLines(DetailAST ast)Get list of empty lines.private static DetailASTNoWhitespaceAfterCheck. getFirstNonArrayDeclaratorParent(DetailAST ast)Get node that ownsARRAY_DECLARATORsequence.private static DetailASTNoWhitespaceAfterCheck. getIdentLastToken(DetailAST ast)Gets leftmost token of identifier.private static DetailASTNoWhitespaceAfterCheck. getIndexOpPreviousElement(DetailAST ast)Gets previous node forINDEX_OPtoken for usage in getPositionAfter method, it is a simplified copy of getArrayDeclaratorPreviousElement method.private static intNoWhitespaceAfterCheck. getPositionAfter(DetailAST ast)Gets position after token (place of possible redundant whitespace).private static DetailASTNoWhitespaceAfterCheck. getPreviousNodeWithParentOfTypeAst(DetailAST ast, DetailAST parent)Finds previous node by text order for an array declarator, which parent type isTYPE.private static DetailASTNoWhitespaceAfterCheck. getTypeLastNode(DetailAST ast)Searches parameter node for a type node.private static DetailASTNoWhitespaceAfterCheck. getWhitespaceFollowedNode(DetailAST ast)For a visited ast node returns node that should be checked for not being followed by whitespace.private booleanEmptyLineSeparatorCheck. hasEmptyLineAfter(DetailAST token)Checks if token have empty line after.private booleanEmptyLineSeparatorCheck. hasEmptyLineBefore(DetailAST token)Checks if a token has a empty line before.private booleanEmptyLineSeparatorCheck. hasMultipleLinesBefore(DetailAST ast)Whether the token has not allowed multiple empty lines before.private booleanEmptyLineSeparatorCheck. hasNotAllowedTwoEmptyLinesBefore(DetailAST token)Checks if a token has empty two previous lines and multiple empty lines is not allowed.private booleanNoWhitespaceAfterCheck. hasTrailingWhitespace(DetailAST ast, int whitespaceColumnNo, int whitespaceLineNo)Checks if there is unwanted whitespace after the visited node.private booleanParenPadCheck. isAcceptableToken(DetailAST ast)Checks whether AcceptableTokens contains the given ast.private static booleanGenericWhitespaceCheck. isAfterMethodReference(DetailAST genericEnd)Checks if current generic end ('>') is located aftermethod reference operator.private static booleanEmptyLineSeparatorCheck. isComment(DetailAST ast)Check if token is a comment.private booleanWhitespaceAroundCheck. isEmptyBlock(DetailAST ast, int parentType)Is empty block.private static booleanWhitespaceAroundCheck. isEmptyBlock(DetailAST ast, int parentType, int match)Tests if a givenDetailASTis part of an empty block.private booleanWhitespaceAroundCheck. isEmptyCatch(DetailAST ast, int parentType)Tests if the givenDetailAstis part of an allowed empty catch block.private booleanWhitespaceAroundCheck. isEmptyCtorBlock(DetailAST ast, int parentType)Test if the givenDetailASTis part of an allowed empty constructor (ctor) block.private booleanWhitespaceAroundCheck. isEmptyLambda(DetailAST ast, int parentType)Test if the givenDetailASTis part of an allowed empty lambda block.private booleanWhitespaceAroundCheck. isEmptyLoop(DetailAST ast, int parentType)Checks if loop is empty.private booleanWhitespaceAroundCheck. isEmptyMethodBlock(DetailAST ast, int parentType)Test if the givenDetailASTis part of an allowed empty method block.private static booleanWhitespaceAroundCheck. isEmptyType(DetailAST ast)Test if the givenDetailASTis part of an empty block.private static booleanWhitespaceAfterCheck. isFollowedByWhitespace(DetailAST targetAST, java.lang.String line)Checks whether token is followed by a whitespace.private static booleanParenPadCheck. isFollowsEmptyForIterator(DetailAST ast)Checks that a token follows an empty for iterator.private static booleanGenericWhitespaceCheck. isGenericBeforeMethod(DetailAST ast)Is generic before method reference.private static booleanNoWhitespaceBeforeCheck. isInEmptyForInitializer(DetailAST semicolonAst)Checks that semicolon is in empty for initializer.private static booleanParenPadCheck. isInTypecast(DetailAST ast)Checks whetherTokenTypes.RPARENis a closing paren of aTokenTypes.TYPECAST.private booleanWhitespaceAroundCheck. isNotRelevantSituation(DetailAST ast, int currentType)Is ast not a target of Check.private static booleanWhitespaceAroundCheck. 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 booleanWhitespaceAroundCheck. 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 booleanEmptyLineSeparatorCheck. isPrecededByJavadoc(DetailAST token)Check if token is preceded by javadoc comment.private static booleanParenPadCheck. isPrecedingEmptyForInit(DetailAST ast)Checks that a token precedes an empty for initializer.private booleanEmptyLineSeparatorCheck. isPrePreviousLineEmpty(DetailAST token)Checks if a token has empty pre-previous line.private static booleanEmptyLineSeparatorCheck. isTypeField(DetailAST variableDef)If variable definition is a type field.private booleanEmptyLineSeparatorCheck. isViolatingEmptyLineBetweenFieldsPolicy(DetailAST detailAST)Checks whether token placement violates policy of empty line between fields.private voidGenericWhitespaceCheck. processEnd(DetailAST ast)Checks the token for the end of Generics.private voidParenPadCheck. processExpression(DetailAST ast)private voidEmptyLineSeparatorCheck. processImport(DetailAST ast, DetailAST nextToken, int astType)Process Import.protected voidAbstractParenPadCheck. processLeft(DetailAST ast)Process a token representing a left parentheses.private voidEmptyLineSeparatorCheck. processMultipleLinesInside(DetailAST ast)Log violation in case there are multiple empty lines inside constructor, initialization block or method.private voidGenericWhitespaceCheck. processNestedGenerics(DetailAST ast, java.lang.String line, int after)Process Nested generics.private voidEmptyLineSeparatorCheck. processPackage(DetailAST ast, DetailAST nextToken)Process Package.protected voidAbstractParenPadCheck. processRight(DetailAST ast)Process a token representing a right parentheses.private voidGenericWhitespaceCheck. processSingleGeneric(DetailAST ast, java.lang.String line, int after)Process Single-generic.private voidGenericWhitespaceCheck. processStart(DetailAST ast)Checks the token for the start of Generics.private voidEmptyLineSeparatorCheck. processVariableDef(DetailAST ast, DetailAST nextToken)Process Variable.private static booleanWhitespaceAroundCheck. shouldCheckSeparationFromNextToken(DetailAST ast, char nextChar)Check if it should be checked if next token is separated from current by whitespace.private static booleanWhitespaceAroundCheck. shouldCheckSeparationFromPreviousToken(DetailAST ast)Check if it should be checked if previous token is separated from current by whitespace.private voidSingleSpaceSeparatorCheck. visitEachToken(DetailAST node)Examines every sibling and child ofnodefor violations.private voidParenPadCheck. visitLiteralFor(DetailAST ast)Checks parens inTokenTypes.LITERAL_FOR.voidEmptyForInitializerPadCheck. visitToken(DetailAST ast)voidEmptyForIteratorPadCheck. visitToken(DetailAST ast)voidEmptyLineSeparatorCheck. visitToken(DetailAST ast)voidGenericWhitespaceCheck. visitToken(DetailAST ast)voidMethodParamPadCheck. visitToken(DetailAST ast)voidNoLineWrapCheck. visitToken(DetailAST ast)voidNoWhitespaceAfterCheck. visitToken(DetailAST ast)voidNoWhitespaceBeforeCheck. visitToken(DetailAST ast)voidOperatorWrapCheck. visitToken(DetailAST ast)voidParenPadCheck. visitToken(DetailAST ast)voidSeparatorWrapCheck. visitToken(DetailAST ast)voidTypecastParenPadCheck. visitToken(DetailAST ast)voidWhitespaceAfterCheck. visitToken(DetailAST ast)voidWhitespaceAroundCheck. visitToken(DetailAST ast)private voidParenPadCheck. 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 DetailASTGeneratedJavaRecognizer. currentGtSequenceThe 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 DetailASTGeneratedJavaRecognizer. 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 voidGeneratedJavaRecognizer. 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. blockCommentToJavadocTreeCache to store already parsed Javadoc comments.Methods in com.puppycrawl.tools.checkstyle.gui that return DetailAST Modifier and Type Method Description private static DetailASTParseTreeTablePresentation. createArtificialTreeRoot()Creates artificial tree root.DetailASTMainFrameModel. parseFile(java.io.File file)Parse a file and return the parse tree.DetailASTMainFrameModel. 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 intCodeSelectorPresentation. findLastPosition(DetailAST astNode)Finds the last position of node without children.private voidCodeSelectorPresentation. findSelectionPositions(DetailAST ast)Find start and end selection positions from AST line and Column.private java.lang.ObjectParseTreeTablePresentation. getChildAtDetailAst(DetailAST parent, int index)Gets child of DetailAST node at specified index.private DetailNodeParseTreeTablePresentation. getJavadocTree(DetailAST blockComment)Gets Javadoc (DetailNode) tree of specified block comments.private java.lang.ObjectParseTreeTablePresentation. getValueAtDetailAST(DetailAST ast, int column)Gets a value for DetailAST object.protected voidParseTreeTableModel. setParseTree(DetailAST parseTree)Sets parse tree.protected voidParseTreeTablePresentation. 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 DetailASTAnnotationUtility. 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 DetailASTAnnotationUtility. getAnnotationHolder(DetailAST ast)Gets the AST that holds a series of annotations for the potentially annotated AST.static DetailASTCheckUtils. getFirstNode(DetailAST node)Finds sub-node for given node minimal (line, column) pair.private static DetailASTBlockCommentPosition. getNextSiblingSkipComments(DetailAST node)Get next sibling node skipping any comment nodes.private static DetailASTBlockCommentPosition. 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 firstOptionalchild token ofDetailASTroot 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 booleanAnnotationUtility. containsAnnotation(DetailAST ast)Checks to see if the AST is annotated with any annotation.static booleanAnnotationUtility. containsAnnotation(DetailAST ast, java.lang.String annotation)Checks to see if the AST is annotated with the passed in annotation.static FullIdentCheckUtils. createFullType(DetailAST typeAST)CreatesFullIdentfor given type node.private static FullIdentCheckUtils. 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 firstOptionalchild token ofDetailASTroot node which matches the given predicate.static AccessModifierCheckUtils. getAccessModifierFromModifiersToken(DetailAST modifiersToken)ReturnsAccessModifierbased on the information about access modifier taken from the given token of typeTokenTypes.MODIFIERS.static DetailASTAnnotationUtility. 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 DetailASTAnnotationUtility. getAnnotationHolder(DetailAST ast)Gets the AST that holds a series of annotations for the potentially annotated AST.private static java.lang.StringJavadocUtils. getBlockCommentContent(DetailAST blockCommentBegin)Gets content of block comment.static DetailASTCheckUtils. getFirstNode(DetailAST node)Finds sub-node for given node minimal (line, column) pair.static java.lang.StringJavadocUtils. getJavadocCommentContent(DetailAST javadocCommentBegin)Get content of Javadoc comment.private static DetailASTBlockCommentPosition. getNextSiblingSkipComments(DetailAST node)Get next sibling node skipping any comment nodes.private static DetailASTBlockCommentPosition. getPrevSiblingSkipComments(DetailAST node)Get previous sibling node skipping any comments.static ScopeScopeUtils. getScopeFromMods(DetailAST aMods)Returns the Scope specified by the modifier set.static ScopeScopeUtils. 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 booleanScopeUtils. isClassFieldDef(DetailAST node)Determines whether a node is a class field definition.static booleanJavadocUtils. isCorrectJavadocPosition(DetailAST blockComment)Checks Javadoc comment it's in right place.private static booleanCheckUtils. isElse(DetailAST ast)Returns whether a token represents an ELSE.static booleanCheckUtils. isElseIf(DetailAST ast)Returns whether a token represents an ELSE as part of an ELSE / IF set.private static booleanCheckUtils. isElseWithCurlyBraces(DetailAST ast)Returns whether a token represents an SLIST as part of an ELSE statement.static booleanCheckUtils. isEqualsMethod(DetailAST ast)Tests whether a method definition AST defines an equals covariant.static booleanCheckUtils. isGetterMethod(DetailAST ast)Returns whether an AST represents a getter method.static booleanScopeUtils. isInAnnotationBlock(DetailAST node)Returns whether a node is directly contained within an annotation block.static booleanScopeUtils. isInCodeBlock(DetailAST node)Returns whether the scope of a node is restricted to a code block.static booleanScopeUtils. isInEnumBlock(DetailAST node)Returns whether a node is directly contained within an enum block.static booleanScopeUtils. isInInterfaceBlock(DetailAST node)Returns whether a node is directly contained within an interface block.static booleanScopeUtils. isInInterfaceOrAnnotationBlock(DetailAST node)Returns whether a node is directly contained within an interface or annotation block.static booleanScopeUtils. isInScope(DetailAST ast, Scope scope)Checks whether ast node is in a specific scope.static booleanJavadocUtils. isJavadocComment(DetailAST blockCommentBegin)Checks block comment content starts with '*' javadoc comment identifier.static booleanScopeUtils. isLocalVariableDef(DetailAST node)Determines whether a node is a local variable definition.static booleanCheckUtils. isNonVoidMethod(DetailAST methodDefAst)Checks whether a method is a not void one.static booleanBlockCommentPosition. isOnAnnotationDef(DetailAST blockComment)Node is on annotation definition.static booleanBlockCommentPosition. isOnClass(DetailAST blockComment)Node is on class definition.static booleanBlockCommentPosition. isOnConstructor(DetailAST blockComment)Node is on constructor.static booleanBlockCommentPosition. isOnEnum(DetailAST blockComment)Node is on enum definition.static booleanBlockCommentPosition. isOnEnumConstant(DetailAST blockComment)Node is on enum constant.static booleanBlockCommentPosition. isOnField(DetailAST blockComment)Node is on field declaration.static booleanBlockCommentPosition. isOnInterface(DetailAST blockComment)Node is on interface definition.static booleanBlockCommentPosition. isOnMethod(DetailAST blockComment)Node is on method declaration.private static booleanBlockCommentPosition. isOnPlainClassMember(DetailAST blockComment, int memberType)Checks that block comment is on specified class member without any modifiers.private static booleanBlockCommentPosition. isOnPlainToken(DetailAST blockComment, int parentTokenType, int nextTokenType)Checks that block comment is on specified token without any modifiers.private static booleanBlockCommentPosition. isOnTokenWithAnnotation(DetailAST blockComment, int tokenType)Checks that block comment is on specified token with annotation.private static booleanBlockCommentPosition. isOnTokenWithModifiers(DetailAST blockComment, int tokenType)Checks that block comment is on specified token with modifiers.static booleanScopeUtils. isOuterMostType(DetailAST node)Returns whether a node is contained in the outer most type block.static booleanCheckUtils. isReceiverParameter(DetailAST parameterDefAst)Checks whether a parameter is a receiver.static booleanCheckUtils. 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 firstOptionalchild token ofDetailASTroot node which matches the given predicate.
-