Uses of Interface
com.puppycrawl.tools.checkstyle.api.DetailAST
Packages that use DetailAST
Package
Description
Contains the implementation of the Checkstyle framework.
Contains the core API to be used to implement checks.
Contains the checks that are bundled with the main distribution.
Contains the Annotation checks that are
bundled with the main distribution.
Contains the Block checks that are
bundled with the main distribution.
Contains the Coding checks that are
bundled with the main distribution.
Contains the Class Design checks that
are bundled with the main distribution.
Contains the Imports checks that are
bundled with the main distribution.
Contains all classes required for the
indentation check.
Contains the Javadoc checks that are bundled with the main distribution.
Contains the Metrics checks that are
bundled with the main distribution.
Contains the modifier checks that are bundled with the main distribution.
Contains the Naming conventions checks
that are bundled with the main distribution.
Contains the regular expression checks that are bundled with the main
distribution.
Contains the Size Violations checks
that are bundled with the main distribution.
Contains the Whitespace checks that
are bundled with the main distribution.
User interface classes for CheckStyle.
Contains classes for generating the Checkstyle website.
Contains utils classes for checkstyle.
Contains the nodes implementations for XPATH queries and query generator.
-
Uses of DetailAST in com.puppycrawl.tools.checkstyle
Classes in com.puppycrawl.tools.checkstyle that implement DetailASTFields in com.puppycrawl.tools.checkstyle declared as DetailASTModifier and TypeFieldDescriptionprivate final DetailASTTreeWalkerAuditEvent.rootAstRoot ast element.Methods in com.puppycrawl.tools.checkstyle that return DetailASTModifier and TypeMethodDescriptionstatic DetailASTJavaParser.appendHiddenCommentNodes(DetailAST root) Appends comment nodes to existing AST.private static DetailASTJavaParser.createCommentAstFromToken(org.antlr.v4.runtime.CommonToken token) Create comment AST from token.private static DetailASTJavaParser.createSlCommentNode(org.antlr.v4.runtime.Token token) Create single-line comment from token.DetailAstImpl.findFirstToken(int tokenType) private static DetailASTJavadocPropertiesGenerator.getClassBody(DetailAST top) Finds the class body of the first class in the DetailAST.DetailAstImpl.getLastChild()DetailAstImpl.getParent()DetailAstImpl.getPreviousSibling()TreeWalkerAuditEvent.getRootAst()Gets the root element of the AST tree.static DetailASTJavaParser.parse(FileContents contents) Static helper method to parses a Java source file.static DetailASTJavaParser.parseFile(File file, JavaParser.Options options) Parses Java source file.static DetailASTJavaParser.parseFileText(FileText text, JavaParser.Options options) Parse a text and return the parse tree.Methods in com.puppycrawl.tools.checkstyle with parameters of type DetailASTModifier and TypeMethodDescriptionvoidAdds a new child to the current AST.voidDetailAstImpl.addNextSibling(DetailAST ast) Add next sibling, pushes other siblings back.voidDetailAstImpl.addPreviousSibling(DetailAST ast) Add previous sibling.static DetailASTJavaParser.appendHiddenCommentNodes(DetailAST root) Appends comment nodes to existing AST.private static intDetailAstImpl.findColumnNo(DetailAST ast) Finds column number in the first non-comment node.private static intDetailAstImpl.findLineNo(DetailAST ast) Finds line number in the first non-comment node.private static StringSuppressionsStringPrinter.generate(FileText fileText, DetailAST detailAST, int lineNumber, int columnNumber, int tabWidth) CreatesXpathQueryGeneratorinstance and generates suppressions.private static DetailASTJavadocPropertiesGenerator.getClassBody(DetailAST top) Finds the class body of the first class in the DetailAST.TreeWalker.getFilteredViolations(String fileName, FileContents fileContents, DetailAST rootAST) Returns filtered set ofViolation.private static StringJavadocPropertiesGenerator.getFirstJavadocSentence(DetailAST ast) Extracts the first sentence as HTML formatted text from the comment of an DetailAST.private static StringAstTreeStringPrinter.getIndentation(DetailAST ast) Get indentation for an AST node.private Collection<AbstractCheck>TreeWalker.getListOfChecks(DetailAST ast, TreeWalker.AstState astState) Method returns list of checks.private static StringExtracts the name of an ast.private static StringAstTreeStringPrinter.getNodeInfo(DetailAST node) Get string representation of the node as token name, node text, line number and column number.private static booleanJavadocPropertiesGenerator.isPublicStaticFinalIntField(DetailAST ast) Checks that the DetailAST is apublicstaticfinalintfield.private static voidJavadocPropertiesGenerator.iteratePublicStaticIntFields(DetailAST objBlock, Consumer<String> consumer) Walks over the type members and push the first javadoc sentence of everypublicstaticintfield to the consumer.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 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.parseJavadocComment(DetailAST javadocCommentAst) Parses the given Javadoc comment AST into aJavadocDetailNodeParser.ParseStatusobject.static StringAstTreeStringPrinter.printBranch(DetailAST node) Print branch info from root down to givennode.private static StringAstTreeStringPrinter.printJavaAndJavadocTree(DetailAST ast) Prints full tree (java + comments + javadoc) of the DetailAST.private static StringPrint AST.private voidTreeWalker.processIter(DetailAST root, TreeWalker.AstState astState) Processes a node calling interested checks at each node.voidDetailAstImpl.setFirstChild(DetailAST firstChild) Sets the first child of this AST.voidDetailAstImpl.setNextSibling(DetailAST nextSibling) Sets the next sibling of this AST.private voidTreeWalker.walk(DetailAST ast, FileContents contents, TreeWalker.AstState astState) Initiates the walk of an AST.Constructors in com.puppycrawl.tools.checkstyle with parameters of type DetailASTModifierConstructorDescriptionTreeWalkerAuditEvent(FileContents fileContents, String fileName, Violation violation, DetailAST rootAst) Creates a newTreeWalkerAuditEventinstance. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.api
Fields in com.puppycrawl.tools.checkstyle.api declared as DetailASTModifier and TypeFieldDescriptionprivate DetailASTFullIdent.detailAstThe topmost and leftmost AST of the full identifier.Methods in com.puppycrawl.tools.checkstyle.api that return DetailASTModifier and TypeMethodDescriptionDetailAST.findFirstToken(int type) Returns the first child token that makes a specified type.FullIdent.getDetailAst()Gets the topmost leftmost DetailAST for this FullIdent.DetailAST.getFirstChild()Get the first child of this AST.DetailAST.getLastChild()Gets the last child node.DetailAST.getNextSibling()Get the next sibling in line after this one.DetailAST.getParent()Returns the parent token.DetailAST.getPreviousSibling()Returns the previous sibling or null if no such sibling exists.Methods in com.puppycrawl.tools.checkstyle.api with parameters of type DetailASTModifier and TypeMethodDescriptionprivate voidAppend the specified token and also recalibrate the first line and column.private static voidFullIdent.appendBrackets(FullIdent full, DetailAST ast) Appends the brackets of an array type to aFullIdent.private static intFullIdent.appendToFull(FullIdent full, DetailAST ast, int dotCounter, boolean bracketsExist, boolean isArrayTypeDeclarationStart) Populates the FullIdent node.voidCalled before the starting to process a tree.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) Extracts a FullIdent.voidAbstractCheck.finishTree(DetailAST rootAST) Called after finished processing a tree.private static booleanFullIdent.isArrayTypeDeclaration(DetailAST arrayDeclarator) Checks an `ARRAY_DECLARATOR` ast to verify that it is not an array initialization, i.e.voidAbstractCheck.leaveToken(DetailAST ast) Called after all the child nodes have been process.final voidHelper method to log a Violation.private static voidFullIdent.pushToIdentStack(Deque<DetailAST> stack, DetailAST ast) Pushes to stack if ast is not null.voidAbstractCheck.visitToken(DetailAST ast) Called to process a token.Method parameters in com.puppycrawl.tools.checkstyle.api with type arguments of type DetailASTModifier and TypeMethodDescriptionprivate static voidFullIdent.pushToIdentStack(Deque<DetailAST> stack, DetailAST ast) Pushes to stack if ast is not null. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks
Fields in com.puppycrawl.tools.checkstyle.checks declared as DetailASTModifier and TypeFieldDescriptionprivate DetailASTOuterTypeFilenameCheck.wrongTypeOuter type with mismatched file name.Methods in com.puppycrawl.tools.checkstyle.checks that return DetailASTModifier and TypeMethodDescriptionprivate static DetailASTSuppressWarningsHolder.getNthChild(DetailAST ast, int index) Returns the n'th child of an AST node.Methods in com.puppycrawl.tools.checkstyle.checks that return types with arguments of type DetailASTModifier and TypeMethodDescriptionSuppressWarningsHolder.getAnnotationTarget(DetailAST ast) Get target of annotation.Methods in com.puppycrawl.tools.checkstyle.checks with parameters of type DetailASTModifier and TypeMethodDescriptionprivate static voidSuppressWarningsHolder.addSuppressions(List<String> values, DetailAST targetAST) Method to populate list of suppression entries.voidvoidvoidvoidprivate voidTrailingCommentCheck.checkBlockComment(DetailAST ast) Method to check if block comment is in correct format.private static booleanUncommentedMainCheck.checkModifiers(DetailAST method) Checks that method has final and static modifiers.private static booleanChecks 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 voidTrailingCommentCheck.checkSingleLineComment(DetailAST ast) Checks if single-line comment is legal.private static booleanChecks that return type isvoid.private voidDescendantTokenCheck.countTokens(DetailAST ast, int depth) Counts the number of occurrences of descendant tokens.SuppressWarningsHolder.findAllExpressionsInChildren(DetailAST parent) Method looks at children and returns list of expressions in strings.voidNoCodeInFileCheck.finishTree(DetailAST ast) voidOuterTypeFilenameCheck.finishTree(DetailAST rootAST) SuppressWarningsHolder.getAllAnnotationValues(DetailAST ast) Get all annotation values.SuppressWarningsHolder.getAnnotationTarget(DetailAST ast) Get target of annotation.SuppressWarningsHolder.getAnnotationValues(DetailAST ast) Returns the annotation values represented by an AST.private static 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 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.isIgnoredPrimitiveParam(DetailAST paramDef) Checks for skip current param due to ignorePrimitiveTypes option.private booleanFinalParametersCheck.isIgnoredUnnamedParam(DetailAST paramDef) Checks for skip current param due to ignoreUnnamedParameters option.private static booleanUncommentedMainCheck.isStringType(DetailAST typeAst) Whether the type is java.lang.String.voidUncommentedMainCheck.leaveToken(DetailAST ast) private voidDescendantTokenCheck.logAsSeparated(DetailAST ast) Log violations for each Token.private voidDescendantTokenCheck.logAsTotal(DetailAST ast) Log validation as one violation.private voidFinalParametersCheck.visitCatch(DetailAST catchClause) Checks parameter of the catch block.private voidUncommentedMainCheck.visitClassOrRecordDef(DetailAST classOrRecordDef) 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.private voidFinalParametersCheck.visitPatternVariableDef(DetailAST patternVariableDef) Checks parameter of the pattern variable definition.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 DetailASTModifier and TypeMethodDescriptionprivate 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 DetailASTReturns the parent node of the comment.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 DetailASTModifier and TypeMethodDescriptionprivate voidAnnotationLocationCheck.checkAnnotations(DetailAST modifierNode, int correctIndentation) Checks annotations positions in code: 1) Checks whether the annotations locations are correct. 2) Checks whether the annotations have the valid indentation level.private voidAnnotationUseStyleCheck.checkCheckClosingParensOption(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 theAnnotationElementStyleOptionis correct.private voidAnnotationUseStyleCheck.checkTrailingComma(DetailAST annotation) Checks to see if the trailing comma is present if required or prohibited.private static booleanMissingOverrideCheck.containsInheritDocTag(DetailAST ast) Checks to see if the ast contains a inheritDoc tag.private static DetailASTSuppressWarningsCheck.findWarningsHolder(DetailAST annotation) Find the parent (holder) of the of the warnings (Expr).private static StringAnnotationLocationCheck.getAnnotationName(DetailAST annotation) Returns the name of the given annotation.private static StringAnnotationOnSameLineCheck.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 node) Returns an expected annotation indentation.private static DetailASTReturns the parent node of the comment.private static DetailASTSuppressWarningsCheck.getSuppressWarnings(DetailAST ast) Gets theSuppressWarningsannotation that is annotating the AST.private static booleanAnnotationUseStyleCheck.hasArguments(DetailAST annotation) Checks that annotation has arguments.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.private booleanAnnotationLocationCheck.isCorrectLocation(DetailAST annotation, boolean hasParams) Checks whether an annotation has a correct location.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.private voidThis method looks for a warning that matches a configured expression.private voidSuppressWarningsCheck.processWarningExpr(DetailAST fChild, DetailAST warning) Processes a single warning expression.private voidSuppressWarningsCheck.processWarnings(DetailAST warning) Processes all warning expressions starting from the given AST node.voidAnnotationLocationCheck.visitToken(DetailAST ast) voidAnnotationOnSameLineCheck.visitToken(DetailAST ast) voidAnnotationUseStyleCheck.visitToken(DetailAST ast) voidMissingOverrideCheck.visitToken(DetailAST ast) voidPackageAnnotationCheck.visitToken(DetailAST ast) voidSuppressWarningsCheck.visitToken(DetailAST ast) private voidSuppressWarningsCheck.walkConditional(DetailAST cond) 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 DetailASTModifier and TypeFieldDescriptionprivate final DetailASTRightCurlyCheck.Details.lcurlyLeft curly.private final DetailASTRightCurlyCheck.Details.nextTokenNext token.private final DetailASTRightCurlyCheck.Details.rcurlyRight curly.Methods in com.puppycrawl.tools.checkstyle.checks.blocks that return DetailASTModifier and TypeMethodDescriptionprivate static DetailASTLeftCurlyCheck.findLastAnnotation(DetailAST modifiers) Find the last token of typeTokenTypes.ANNOTATIONunder the given set of modifiers.private static DetailASTLeftCurlyCheck.getBraceAsFirstChild(DetailAST ast) Gets a SLIST if it is the first child of the AST.private static DetailASTLeftCurlyCheck.getBraceFromSwitchMember(DetailAST ast) Gets the brace of a switch statement/ expression member.private static DetailASTNeedBracesCheck.getLastLambdaToken(DetailAST lambda) Looks for the last token in lambda.private static DetailASTRightCurlyCheck.Details.getNextToken(DetailAST ast) Finds next token after the given one.private static DetailASTLeftCurlyCheck.skipModifierAnnotations(DetailAST ast) Skip allTokenTypes.ANNOTATIONs to the first non-annotation.Methods in com.puppycrawl.tools.checkstyle.checks.blocks that return types with arguments of type DetailASTModifier and TypeMethodDescriptionEmptyBlockCheck.getLeftCurly(DetailAST ast) Calculates the left curly corresponding to the block to be checked.Methods in com.puppycrawl.tools.checkstyle.checks.blocks with parameters of type DetailASTModifier and TypeMethodDescriptionprivate static DetailASTLeftCurlyCheck.findLastAnnotation(DetailAST modifiers) Find the last token of typeTokenTypes.ANNOTATIONunder the given set of modifiers.private static DetailASTLeftCurlyCheck.getBraceAsFirstChild(DetailAST ast) Gets a SLIST if it is the first child of the AST.private static DetailASTLeftCurlyCheck.getBraceFromSwitchMember(DetailAST ast) Gets the brace of a switch statement/ expression member.private static 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.getDetailsForCase(DetailAST caseNode) Collects details about case statements.private static RightCurlyCheck.DetailsRightCurlyCheck.Details.getDetailsForDoLoops(DetailAST ast) Collects validation details for LITERAL_DO loops' tokens.private static RightCurlyCheck.DetailsRightCurlyCheck.Details.getDetailsForIf(DetailAST ast) Collects validation details for LITERAL_IF.private static RightCurlyCheck.DetailsRightCurlyCheck.Details.getDetailsForOthers(DetailAST ast) Collects validation details for CLASS_DEF, RECORD_DEF, METHOD DEF, CTOR_DEF, STATIC_INIT, INSTANCE_INIT, ANNOTATION_DEF, ENUM_DEF, and COMPACT_CTOR_DEF.private static RightCurlyCheck.DetailsRightCurlyCheck.Details.getDetailsForSwitch(DetailAST switchNode) Collects details about switch statements and expressions.private static RightCurlyCheck.DetailsRightCurlyCheck.Details.getDetailsForTryCatch(DetailAST ast) Collects validation details for LITERAL_TRY, and LITERAL_CATCH.private static StringEmptyCatchBlockCheck.getExceptionVariableName(DetailAST catchAst) Gets variable's name associated with exception.private static DetailASTNeedBracesCheck.getLastLambdaToken(DetailAST lambda) Looks for the last token in lambda.EmptyBlockCheck.getLeftCurly(DetailAST ast) Calculates the left curly corresponding to the block to be checked.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.private static booleanAvoidNestedBlocksCheck.hasSiblings(DetailAST ast) Checks whether the AST node has any siblings or not.private booleanChecks if SLIST token contains any text.private static booleanNeedBracesCheck.hasUnbracedStatements(DetailAST ast) Checks if switch member (case, default statements) has statements without curly braces.private booleanNeedBracesCheck.isBracesNeeded(DetailAST ast) Checks if token needs braces.private static booleanEmptyCatchBlockCheck.isEmptyCatchBlock(DetailAST catchAst) Checks if catch block is empty or contains only comments.private booleanNeedBracesCheck.isEmptyLoopBodyAllowed(DetailAST ast) Checks if current loop has empty body and can be skipped by this check.private static booleanNeedBracesCheck.isInSwitchRule(DetailAST ast) Checks if current ast's parent is a switch rule, e.g.:private static booleanNeedBracesCheck.isSingleLineCaseGroup(DetailAST ast) Checks if switch member in case group (case or 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.isSingleLineSwitchMember(DetailAST statement) Checks if switch member (case or default statement) in a switch rule or case group is on a single-line.private static booleanNeedBracesCheck.isSingleLineSwitchRule(DetailAST ast) Checks if switch member in switch rule (case or default 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 static booleanRightCurlyCheck.Details.isSwitchExpression(DetailAST switchNode) Check whether switch is expression or not.private booleanEmptyCatchBlockCheck.isVerifiable(DetailAST emptyCatchAst, 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.skipModifierAnnotations(DetailAST ast) Skip allTokenTypes.ANNOTATIONs to the first non-annotation.private voidLeftCurlyCheck.validateEol(DetailAST brace, String braceLine) Validate EOL case.private voidLeftCurlyCheck.validateNewLinePosition(DetailAST brace, DetailAST startToken, 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) Visits token.voidNeedBracesCheck.visitToken(DetailAST ast) voidRightCurlyCheck.visitToken(DetailAST ast) Constructors in com.puppycrawl.tools.checkstyle.checks.blocks with parameters of type DetailAST -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.coding
Fields in com.puppycrawl.tools.checkstyle.checks.coding declared as DetailASTModifier and TypeFieldDescriptionprivate final DetailASTUnusedLambdaParameterShouldBeUnnamedCheck.LambdaParameterDetails.enclosingLambdaAst of typeTokenTypes.LAMBDAenclosing the lambda parameter.private final DetailASTRequireThisCheck.AbstractFrame.frameNameIdentName identifier token.private final DetailASTUnusedLambdaParameterShouldBeUnnamedCheck.LambdaParameterDetails.identifierAstAst of typeTokenTypes.IDENTof the given lambda parameter.private final DetailASTAbstractSuperCheck.MethodNode.methodMethod definition.private final DetailASTUnusedCatchParameterShouldBeUnnamedCheck.CatchParameterDetails.parameterDefinitionAst of typeTokenTypes.PARAMETER_DEFto use it when logging.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 final DetailASTUnusedLocalVariableCheck.VariableDesc.scopeThe scope of variable is determined by the ast of typeTokenTypes.SLISTorTokenTypes.LITERAL_FORorTokenTypes.OBJBLOCKwhich is enclosing the variable.private final DetailASTUnusedLocalVariableCheck.VariableDesc.typeAstAst of typeTokenTypes.TYPE.private final DetailASTUnusedLocalVariableCheck.TypeDeclDesc.typeDeclAstType declaration ast node.private final DetailASTFinalLocalVariableCheck.FinalVariableCandidate.variableIdentIdentifier token.Fields in com.puppycrawl.tools.checkstyle.checks.coding with type parameters of type DetailASTModifier and TypeFieldDescriptionprivate final Map<DetailAST,UnusedLocalVariableCheck.TypeDeclDesc> UnusedLocalVariableCheck.anonInnerAstToTypeDeclDescMaps local anonymous inner class to the TypeDeclDesc object containing it.UnusedLocalVariableCheck.anonInnerClassHoldersSet of tokens of typeUnusedLocalVariableCheck.ANONYMOUS_CLASS_PARENT_TOKENSandTokenTypes.LAMBDAin some cases.FinalLocalVariableCheck.currentScopeAssignedVariablesAssigned variables of current scope.CovariantEqualsCheck.equalsMethodsSet of equals method definitions.EqualsAvoidNullCheck.FieldFrame.fieldNameToAstMap of field name to field DetailAst.private Map<DetailAST,RequireThisCheck.AbstractFrame> RequireThisCheck.framesTree of all the parsed frames.AvoidDoubleBraceInitializationCheck.HAS_MEMBERSPredicate for tokens that is used inAvoidDoubleBraceInitializationCheck.hasOnlyInitialization(DetailAST).RequireThisCheck.ClassFrame.instanceMembersSet of idents of instance members declared in this frame.RequireThisCheck.ClassFrame.instanceMethodsSet of idents of instance methods declared in this frame.IllegalInstantiationCheck.instantiationsThe instantiations in the file.EqualsAvoidNullCheck.FieldFrame.methodCallsSet of equals calls.EqualsHashCodeCheck.objBlockWithEqualsMaps OBJ_BLOCK to the method definition of equals().EqualsHashCodeCheck.objBlockWithEqualsMaps OBJ_BLOCK to the method definition of equals().EqualsHashCodeCheck.objBlockWithHashCodeMaps OBJ_BLOCKs to the method definition of hashCode().EqualsHashCodeCheck.objBlockWithHashCodeMaps OBJ_BLOCKs to the method definition of hashCode().FinalLocalVariableCheck.ScopeData.prevScopeUninitializedVariablesContains definitions of previous scope uninitialized variables.RequireThisCheck.ClassFrame.staticMembersSet of idents of variables declared in this frame.RequireThisCheck.ClassFrame.staticMethodsSet of idents of static methods declared in this frame.MultipleStringLiteralsCheck.stringMapThe found strings and their tokens.private final Map<DetailAST,UnusedLocalVariableCheck.TypeDeclDesc> UnusedLocalVariableCheck.typeDeclAstToTypeDeclDescMaps type declaration ast to their respective TypeDeclDesc objects.FinalLocalVariableCheck.ScopeData.uninitializedVariablesContains definitions of uninitialized variables.RequireThisCheck.AbstractFrame.varIdentsSet of name of variables declared in this frame.Methods in com.puppycrawl.tools.checkstyle.checks.coding that return DetailASTModifier and TypeMethodDescriptionprivate static DetailASTMagicNumberCheck.findContainingConstantDef(DetailAST ast) Finds the constant definition that contains aAST.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.findLastCaseGroupWhichContainsSlist(DetailAST literalSwitchAst) Returns the last token of typeTokenTypes.CASE_GROUPwhich containsTokenTypes.SLIST.private static DetailASTUnusedLocalVariableCheck.findScopeOfVariable(DetailAST variableDef) Find the scope of variable.private static DetailASTUnusedLocalVariableCheck.getBlockContainingLocalAnonInnerClass(DetailAST literalNewAst) Get the block containing local anon inner class.private static DetailASTRequireThisCheck.getBlockEndToken(DetailAST blockNameIdent, DetailAST blockStartToken) Returns the token which ends the code block.private static DetailASTPatternVariableAssignmentCheck.getBranchLeadingToReassignedVars(DetailAST ast) Gets the closest consistent AST branch that leads to reassigned variable's ident.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!).RequireThisCheck.AbstractFrame.getFrameNameIdent()Returns the name identifier token.private DetailASTUnusedLambdaParameterShouldBeUnnamedCheck.LambdaParameterDetails.getIdentifierAst()Get ast of typeTokenTypes.IDENTof the given lambda parameter.private static DetailASTMultipleVariableDeclarationsCheck.getLastNode(DetailAST node) Finds sub-node for given node maximum (line, column) pair.private static DetailASTPatternVariableAssignmentCheck.getMatchedAssignToken(DetailAST preAssignBranch) Gets the type of ASSIGN tokens that particularly matches with what follows the preceding branch.AbstractSuperCheck.MethodNode.getMethod()Returns the overriding method definition AST.private static DetailASTPatternVariableAssignmentCheck.getNeededAssignIdent(DetailAST assignToken) Gets the needed AST Ident of reassigned variable for check to compare.private static DetailASTFallThroughCheck.getNextNonCommentAst(DetailAST ast) This method will skip the comment content while finding the next ast of current 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 DetailASTUnusedCatchParameterShouldBeUnnamedCheck.CatchParameterDetails.getParameterDefinition()Get the parameter definition token of the catch parameter represented by ast of typeTokenTypes.PARAMETER_DEF.private static DetailASTGet ast parent, ignoring token types fromskipTokens.private static DetailASTFinalLocalVariableCheck.getParentLoop(DetailAST ast) Get the ast node of typeFinalLocalVariableCheck.LOOP_TYPESthat is the ancestor of the current ast node, if there is no such node, null is returned.UnusedLocalVariableCheck.VariableDesc.getScope()Get ast of typeTokenTypes.SLISTorTokenTypes.LITERAL_FORorTokenTypes.OBJBLOCKwhich is enclosing the variable i.e. its scope.private static DetailASTWhenShouldBeUsedCheck.getStatementList(DetailAST caseAST) Get the statement list token of the case block.UnusedLocalVariableCheck.VariableDesc.getTypeAst()Get the associated ast node of typeTokenTypes.TYPE.UnusedLocalVariableCheck.TypeDeclDesc.getTypeDeclAst()Get the type declaration ast node.private static DetailASTPatternVariableAssignmentCheck.shiftToNextTraversedBranch(DetailAST ast, DetailAST boundAst) Shifts once to the next possible branch within traverse trajectory.private static DetailASTEqualsAvoidNullCheck.skipVariableAssign(DetailAST currentAST) Skips over an inner assign portion of an argument expression.private static DetailASTPatternVariableAssignmentCheck.traverseUntilNeededBranchType(DetailAST startingBranch, DetailAST bound, int neededTokenType) Traverses along the AST tree to locate the first branch of certain token type.Methods in com.puppycrawl.tools.checkstyle.checks.coding that return types with arguments of type DetailASTModifier and TypeMethodDescriptionVariableDeclarationUsageDistanceCheck.calculateDistanceBetweenScopes(DetailAST ast, DetailAST variable) Calculates distance between declaration of variable and its first usage in multiple scopes.VariableDeclarationUsageDistanceCheck.calculateDistanceInSingleScope(DetailAST semicolonAst, DetailAST variableIdentAst) Calculates distance between declaration of variable and its first usage in single scope.ModifiedControlVariableCheck.findChildrenOfExpressionType(DetailAST ast) Find all child of given AST of type TokenType.EXPR.MatchXpathCheck.findMatchingNodesByXpathQuery(DetailAST rootAST) Find nodes that match query.UnnecessaryNullCheckWithInstanceOfCheck.findRedundantNullCheck(DetailAST logicalAndNode, DetailAST instanceOfNode) Finds a redundant null check in a logical AND expression combined with an instanceof check.UnnecessaryNullCheckWithInstanceOfCheck.findUnnecessaryNullCheck(DetailAST instanceOfNode) Checks for an unnecessary null check within a logical AND expression.MissingNullCaseInSwitchCheck.getAllCaseLabels(DetailAST switchAST) Gets all case labels in the given switch AST node.DeclarationOrderCheck.getAllTokensOfType(DetailAST ast, int tokenType) Collects all tokens of specific type starting with the current ast node.RequireThisCheck.getAllTokensOfType(DetailAST ast, int tokenType) Collects all tokens of specific type starting with the current ast node.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.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.WhenShouldBeUsedCheck.getBlockStatements(DetailAST statementList) Get all statements inside the case block.ConstructorsDeclarationGroupingCheck.getChildList(DetailAST ast) Get a list of all children of the given AST.EqualsAvoidNullCheck.FieldFrame.getMethodCalls()Getter for frame's method calls.UnnecessaryParenthesesCheck.getParenthesesChildrenAroundQuestion(DetailAST questionToken) Returns the direct LPAREN tokens children to a given QUESTION token which contain an expression not a literal variable.PatternVariableAssignmentCheck.getPatternVariableIdents(DetailAST ast) Gets the list of all pattern variable idents in instanceof expression.PatternVariableAssignmentCheck.getReassignedVariableIdents(DetailAST ast) Gets the array list made out of AST branches of reassigned variable idents.VariableDeclarationUsageDistanceCheck.getVariableUsageExpressionsInsideSwitchBlock(DetailAST block, DetailAST variable) Helper method for getFirstNodeInsideSwitchBlock to return all variable usage expressions inside a given switch block.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 DetailASTModifier and TypeMethodDescriptionvoidAdd field to this FieldFrame.private voidAdd 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.private voidUnusedLocalVariableCheck.addInstanceOrClassVar(DetailAST varDefAst) Add instance variables and class variables to theUnusedLocalVariableCheck.TypeDeclDesc.instanceAndClassVarStack.private static voidUnusedLocalVariableCheck.addLocalVariables(DetailAST varDefAst, Deque<UnusedLocalVariableCheck.VariableDesc> variablesStack) Add local variables to thevariablesStackstack.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.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidVariableDeclarationUsageDistanceCheck.calculateDistanceBetweenScopes(DetailAST ast, DetailAST variable) Calculates distance between declaration of variable and its first usage in multiple scopes.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 static booleanRequireThisCheck.canBeReferencedFromStaticContext(DetailAST ident) Checks whether a field can be referenced from a static context.private static booleanSimplifyBooleanReturnCheck.canReturnOrYieldOnlyBooleanLiteral(DetailAST ast) Returns if an AST is a return or a yield statement with a boolean literal or a compound statement that contains only such a return or a yield statement.private voidIllegalTypeCheck.checkBaseTypes(DetailAST clause) Checks theextendsorimplementsstatement.private static booleanUnnecessaryParenthesesCheck.checkBitwiseBinaryOperator(DetailAST ast) Check if bitwise binary operator has unnecessary parentheses.private voidIllegalTypeCheck.checkClassName(DetailAST ast) Checks type and type arguments/parameters of given method, parameter, variable or method call/reference.private static booleanUnnecessaryParenthesesCheck.checkConditionalOrRelationalOperator(DetailAST ast) Check if conditional or relational operator has unnecessary parentheses.voidReturnCountCheck.Context.checkCount(DetailAST ast) Checks if number of return statements in the method are more than allowed.private voidUnnecessarySemicolonAfterTypeMemberDeclarationCheck.checkEnumConstant(DetailAST ast) Checks if enum constant has unnecessary semicolon.private voidUnnecessaryParenthesesCheck.checkExpression(DetailAST ast) Checks whether an expression is surrounded by parentheses.private voidIllegalTypeCheck.checkIdent(DetailAST type) Checks the identifier of the given type.private voidModifiedControlVariableCheck.checkIdent(DetailAST ast) Check if ident is parameter.private static voidUnusedLocalVariableCheck.checkIdentifierAst(DetailAST identAst, Deque<UnusedLocalVariableCheck.VariableDesc> variablesStack) Checks the identifier ast.private booleanChecks 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 voidOneStatementPerLineCheck.checkLambda(DetailAST ast, DetailAST currentStatement) Checks semicolon placement in lambda.private booleanChecks 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 voidParameterAssignmentCheck.checkNestedIdent(DetailAST ast) Check if nested ident is parameter.private voidOverloadMethodsDeclarationOrderCheck.checkOverloadMethodsGrouping(DetailAST objectBlock) Checks that if overload methods are grouped together they should not be separated from each other.private voidOneStatementPerLineCheck.checkResourceVariable(DetailAST currentStatement) Checks resource variable.private booleanFallThroughCheck.checkSlist(DetailAST slistAst, boolean useBreak, boolean useContinue, Set<String> labels) Checks if a given SLIST terminated by return, throw or, if allowed break, continue.private booleanFallThroughCheck.checkSwitch(DetailAST literalSwitchAst, boolean useContinue, Set<String> labels) Checks if a given switch terminated by return, throw or, if allowed break, continue.private booleanFallThroughCheck.checkSynchronized(DetailAST synchronizedAst, boolean useBreak, boolean useContinue, Set<String> labels) Checks if a given synchronized block terminated by return, throw or, if allowed break, continue.private booleanChecks if a given try/catch/finally block terminated by return, throw or, if allowed break, continue.private voidChecks the given type, its arguments and parameters.private voidIllegalTypeCheck.checkTypeArguments(DetailAST node) Checks the type arguments of the node.private voidIllegalTypeCheck.checkTypeBounds(DetailAST type) Checks the upper and lower bounds for the given type.private voidUnnecessarySemicolonAfterTypeMemberDeclarationCheck.checkTypeDefinition(DetailAST ast) Checks if type definition has unnecessary semicolon.private voidUnnecessarySemicolonAfterTypeMemberDeclarationCheck.checkTypeMember(DetailAST ast) Checks if type member has unnecessary semicolon.private voidIllegalTypeCheck.checkTypeParameters(DetailAST node) Checks the type parameters of the node.private voidUnnecessarySemicolonAfterTypeMemberDeclarationCheck.checkVariableDefinition(DetailAST variableDef) Checks if variable definition has unnecessary semicolon.private static voidRequireThisCheck.collectDeclarations(Deque<RequireThisCheck.AbstractFrame> frameStack, DetailAST ast) Parses the next AST for declarations.private static voidRequireThisCheck.collectMethodDeclarations(Deque<RequireThisCheck.AbstractFrame> frameStack, DetailAST ast, RequireThisCheck.AbstractFrame frame) CollectsMETHOD_DEFdeclarations.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.containsDefaultCaseLabelElement(DetailAST detailAst) Checks if a switch block contains a default case label.private static booleanMissingSwitchDefaultCheck.containsDefaultLabel(DetailAST detailAst) Checks if the case group or its sibling contain the 'default' switch.protected booleanRequireThisCheck.AbstractFrame.containsFieldOrVariable(DetailAST identToFind) Check whether the frame contains a field or a variable with the given name.protected booleanRequireThisCheck.ClassFrame.containsFieldOrVariable(DetailAST identToFind) protected booleanRequireThisCheck.AbstractFrame.containsFieldOrVariableDef(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(Set<DetailAST> set, DetailAST ident) Whether the set contains a method definition with the same name and number of parameters.private static booleanMissingSwitchDefaultCheck.containsNullCaseLabelElement(DetailAST detailAst) Checks if a switch block contains a null case label.private static booleanEqualsAvoidNullCheck.containsOneArgument(DetailAST methodCall) Verify that method call has one argument.private static booleanMissingSwitchDefaultCheck.containsPatternCaseLabelElement(DetailAST detailAst) Checks if a switch block contains a case label with a pattern variable definition or record pattern definition.private static booleanUnnecessaryNullCheckWithInstanceOfCheck.containsVariableDereference(DetailAST node, String variableName) Checks if the given AST node contains a method call or field access on the specified variable.private static StringIllegalTokenCheck.convertToString(DetailAST ast) Converts given AST node to string representation.private voidUnusedLocalVariableCheck.customLeaveToken(DetailAST ast, Deque<UnusedLocalVariableCheck.VariableDesc> variablesStack) Leave all ast nodes underUnusedLocalVariableCheck.anonInnerClassHoldersonce again.private voidUnusedLocalVariableCheck.customVisitToken(DetailAST ast, Deque<UnusedLocalVariableCheck.VariableDesc> variablesStack) Visit all ast nodes underUnusedLocalVariableCheck.anonInnerClassHoldersonce again.private static voidFinalLocalVariableCheck.determineAssignmentConditions(DetailAST ident, FinalLocalVariableCheck.FinalVariableCandidate candidate) Determines identifier assignment conditions (assigned or already assigned).private voidRequireThisCheck.endCollectingDeclarations(Queue<RequireThisCheck.AbstractFrame> frameStack, DetailAST ast) Ends parsing of the AST for declarations.ModifiedControlVariableCheck.findChildrenOfExpressionType(DetailAST ast) Find all child of given AST of type TokenType.EXPR.private 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.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.AbstractFrameFind frame containing declaration.private static RequireThisCheck.AbstractFrameRequireThisCheck.findFrame(RequireThisCheck.AbstractFrame frame, DetailAST name, boolean lookForMethod) Find frame containing declaration.private static DetailASTFinalLocalVariableCheck.findLastCaseGroupWhichContainsSlist(DetailAST literalSwitchAst) Returns the last token of typeTokenTypes.CASE_GROUPwhich containsTokenTypes.SLIST.MatchXpathCheck.findMatchingNodesByXpathQuery(DetailAST rootAST) Find nodes that match query.UnnecessaryNullCheckWithInstanceOfCheck.findRedundantNullCheck(DetailAST logicalAndNode, DetailAST instanceOfNode) Finds a redundant null check in a logical AND expression combined with an instanceof check.private static DetailASTUnusedLocalVariableCheck.findScopeOfVariable(DetailAST variableDef) Find the scope of variable.UnnecessaryNullCheckWithInstanceOfCheck.findUnnecessaryNullCheck(DetailAST instanceOfNode) Checks for an unnecessary null check within a logical AND expression.voidEqualsAvoidNullCheck.finishTree(DetailAST ast) voidEqualsHashCodeCheck.finishTree(DetailAST rootAST) voidIllegalInstantiationCheck.finishTree(DetailAST rootAST) voidMultipleStringLiteralsCheck.finishTree(DetailAST rootAST) voidPackageDeclarationCheck.finishTree(DetailAST ast) MissingNullCaseInSwitchCheck.getAllCaseLabels(DetailAST switchAST) Gets all case labels in the given switch AST node.DeclarationOrderCheck.getAllTokensOfType(DetailAST ast, int tokenType) Collects all tokens of specific type starting with the current ast node.RequireThisCheck.getAllTokensOfType(DetailAST ast, int tokenType) Collects all tokens of specific type starting with the current ast node.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.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 DetailASTUnusedLocalVariableCheck.getBlockContainingLocalAnonInnerClass(DetailAST literalNewAst) Get the block containing local anon inner class.private static DetailASTRequireThisCheck.getBlockEndToken(DetailAST blockNameIdent, DetailAST blockStartToken) Returns the token which ends the code block.WhenShouldBeUsedCheck.getBlockStatements(DetailAST statementList) Get all statements inside the case block.private static DetailASTPatternVariableAssignmentCheck.getBranchLeadingToReassignedVars(DetailAST ast) Gets the closest consistent AST branch that leads to reassigned variable's ident.ConstructorsDeclarationGroupingCheck.getChildList(DetailAST ast) Get a list of all children of the given AST.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, int currentDistToVarUsage) Returns the distance to variable usage for in the child node.private static StringEqualsAvoidNullCheck.FieldFrame.getFieldName(DetailAST field) Get the name of the field.private static 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.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!).ModifiedControlVariableCheck.getForInitVariables(DetailAST ast) Get all variables initialized In init part of for loop.ModifiedControlVariableCheck.getForIteratorVariables(DetailAST ast) Get all variables which for loop iterating part change in every loop.protected RequireThisCheck.AbstractFrameRequireThisCheck.AbstractFrame.getIfContains(DetailAST identToFind, boolean lookForMethod) Check whether the frame contains a given name.protected RequireThisCheck.AbstractFrameRequireThisCheck.CatchFrame.getIfContains(DetailAST identToFind, boolean lookForMethod) protected RequireThisCheck.AbstractFrameRequireThisCheck.ClassFrame.getIfContains(DetailAST identToFind, boolean lookForMethod) private static StringIllegalTypeCheck.getImportedTypeCanonicalName(DetailAST importAst) Gets imported type's canonical name.private static 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 static DetailASTPatternVariableAssignmentCheck.getMatchedAssignToken(DetailAST preAssignBranch) Gets the type of ASSIGN tokens that particularly matches with what follows the preceding branch.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 DetailASTPatternVariableAssignmentCheck.getNeededAssignIdent(DetailAST assignToken) Gets the needed AST Ident of reassigned variable for check to compare.private static DetailASTFallThroughCheck.getNextNonCommentAst(DetailAST ast) This method will skip the comment content while finding the next ast of current 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 DetailASTGet ast parent, ignoring token types fromskipTokens.UnnecessaryParenthesesCheck.getParenthesesChildrenAroundQuestion(DetailAST questionToken) Returns the direct LPAREN tokens children to a given QUESTION token which contain an expression not a literal variable.private static DetailASTFinalLocalVariableCheck.getParentLoop(DetailAST ast) Get the ast node of typeFinalLocalVariableCheck.LOOP_TYPESthat is the ancestor of the current ast node, if there is no such node, null is returned.PatternVariableAssignmentCheck.getPatternVariableIdents(DetailAST ast) Gets the list of all pattern variable idents in instanceof expression.private StringUnusedLocalVariableCheck.getQualifiedTypeDeclarationName(DetailAST typeDeclAst) Get qualified type declaration name from type ast.PatternVariableAssignmentCheck.getReassignedVariableIdents(DetailAST ast) Gets the array list made out of AST branches of reassigned variable idents.private static DetailASTWhenShouldBeUsedCheck.getStatementList(DetailAST caseAST) Get the statement list token of the case block.UnusedLocalVariableCheck.getSuperClassOfAnonInnerClass(DetailAST literalNewAst) Get theUnusedLocalVariableCheck.TypeDeclDescof the super class of anonymous inner class.UnusedLocalVariableCheck.TypeDeclDesc.getUpdatedCopyOfVarStack(DetailAST literalNewAst) Get the copy of variables in instanceAndClassVar stack with updated scope.ModifiedControlVariableCheck.getVariablesManagedByForLoop(DetailAST ast) Determines which variable are specific to for loop and should not be change by inner loop body.VariableDeclarationUsageDistanceCheck.getVariableUsageExpressionsInsideSwitchBlock(DetailAST block, DetailAST variable) Helper method for getFirstNodeInsideSwitchBlock to return all variable usage expressions inside a given switch block.private static booleanAbstractSuperCheck.hasArguments(DetailAST methodCallDotAst) Does method have any arguments.private booleanFallThroughCheck.hasFallThroughComment(DetailAST currentCase) Determines if the fall through case betweencurrentCaseandnextCaseis relieved by an 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.private static booleanChecks if given break or continue ast has outer label.private static booleanMissingNullCaseInSwitchCheck.hasLiteralNull(DetailAST caseAST) Checks if the given case AST node has a null label.private static booleanMissingSwitchDefaultCheck.hasNullCaseLabel(DetailAST detailAST) Checks if the case contains null label.private static booleanAvoidDoubleBraceInitializationCheck.hasOnlyInitialization(DetailAST objBlock) Checks that block has at least one instance init block and no other class members.private static booleanMissingNullCaseInSwitchCheck.hasPatternCaseLabel(DetailAST caseAST) Checks if the given case AST node has a pattern variable declaration label or record pattern definition label.private static booleanWhenShouldBeUsedCheck.hasPatternLabel(DetailAST caseAST) Check if the case block has a pattern variable definition or a record pattern definition.private booleanFallThroughCheck.hasReliefComment(DetailAST ast) Check if there is any fall through comment.booleanRequireThisCheck.ClassFrame.hasStaticMethod(DetailAST ident) Checks if a given name is a known static method of the class.private static booleanMissingNullCaseInSwitchCheck.hasStringCaseLabel(DetailAST caseAST) Checks if the given case contains a string in its label.private static booleanStringLiteralEqualityCheck.hasStringLiteralChild(DetailAST ast) Checks whether string literal or text block literals are concatenated.private static booleanUnusedLambdaParameterShouldBeUnnamedCheck.hasValidParentToken(DetailAST identifierAst) Check if the givenTokenTypes.IDENThas a valid parent token.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 booleanWhenShouldBeUsedCheck.isAcceptableStatement(DetailAST ast) Check if the statement is an acceptable statement inside the case block.private static booleanRequireThisCheck.isAnonymousClassDef(DetailAST ast) Whether the AST is a definition of an anonymous class.private static booleanRequireThisCheck.isAstInside(DetailAST tree, DetailAST ast) Checks if the givenastis equal to thetreeor a child of it.private static booleanRequireThisCheck.isAstSimilar(DetailAST left, DetailAST right) Checks if 2 AST are similar by their type and text.private static booleanSimplifyBooleanReturnCheck.isBooleanLiteralReturnOrYieldStatement(DetailAST ast) Returns if an AST is a return or a yield statement with a boolean literal.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 or SWITCH_RULE and there is anothercasefollowing.private static booleanUnusedCatchParameterShouldBeUnnamedCheck.isCatchParameterIdentifierCandidate(DetailAST identifierAst) Visit ast of typeTokenTypes.IDENTand check if it is a candidate for a catch parameter identifier.private booleanIllegalTypeCheck.isCheckedMethod(DetailAST ast) Returns true if method has to be checked or false.private static booleanChecks if Ast node contains given element.private static booleanDetermines 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 static booleanConstructorsDeclarationGroupingCheck.isConstructor(DetailAST ast) Check if the given AST is a constructor.private booleanIllegalTypeCheck.isContainVerifiableType(DetailAST modifiers) Checks is modifiers contain verifiable type.private static booleanReturns whether a token represents an ELSE.private static booleanReturns whether a token represents an ELSE as part of an ELSE / IF set.private static booleanNestedIfDepthCheck.isElseWithCurlyBraces(DetailAST ast) Returns whether a token represents an SLIST as part of an ELSE statement.private static booleanUnnecessarySemicolonInEnumerationCheck.isEndOfEnumerationAfter(DetailAST ast) Checks if enum body has no code elements after enum constants semicolon.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 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, 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, 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 booleanRequireThisCheck.isInCompactConstructor(DetailAST ast) Return whether ast is in a COMPACT_CTOR_DEF.private static booleanInnerAssignmentCheck.isInContext(DetailAST ast, int[][] contextSet, BitSet skipTokens) Tests whether the provided AST is in one of the given contexts.private static booleanUnusedLocalVariableCheck.isIncrementOrDecrementVariableUsed(DetailAST exprAst) A variable with increment or decrement operator is considered used if it is used as an argument or as an array index or for assigning value to a variable.private static booleanRequireThisCheck.isInExpression(DetailAST ast) Checks ast parent is in expression.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, 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.isInLoopIdiom(DetailAST ast) Tests whether the given AST is used in the "assignment in loop" idiom.private static booleanFinalLocalVariableCheck.isInMethodWithoutBody(DetailAST parameterDefAst) Checks if a parameter is within a method that has no implementation body.private static booleanInnerAssignmentCheck.isInNoBraceControlStatement(DetailAST ast) Determines if ast is in the body of a flow control statement without braces.private static booleanUnusedLocalVariableCheck.isInsideLocalAnonInnerClass(DetailAST literalNewAst) Whether ast node of typeTokenTypes.LITERAL_NEWis a part of a local anonymous inner class.private static booleanFinalLocalVariableCheck.isInSpecificCodeBlocks(DetailAST node, int... blockTypes) Checks whether the scope of a node is restricted to a specific code blocks.private booleanHiddenFieldCheck.isInstanceField(DetailAST ast, String name) Check for instance field.private static booleanHiddenFieldCheck.isInStatic(DetailAST ast) Determines whether an AST node is in a static method or static initializer.private static booleanRequireThisCheck.isLambdaParameter(DetailAST ast) Checks if the token is a Lambda parameter.private static booleanUnusedLambdaParameterShouldBeUnnamedCheck.isLambdaParameterIdentifierCandidate(DetailAST identifierAst) Visit ast of typeTokenTypes.IDENTand check if it is a candidate for a lambda parameter identifier.private static booleanUnnecessaryParenthesesCheck.isLambdaSingleParameterSurrounded(DetailAST ast) Tests if the given node has a single parameter, no defined type, and is surrounded by parentheses.private static booleanUnusedCatchParameterShouldBeUnnamedCheck.isLeftHandOfAssignment(DetailAST identAst) Check if the givenTokenTypes.IDENTis a left hand side value.private static booleanUnusedLambdaParameterShouldBeUnnamedCheck.isLeftHandOfAssignment(DetailAST identAst) Check if the givenTokenTypes.IDENTis a left hand side value.private static booleanUnusedLocalVariableCheck.isLeftHandSideValue(DetailAST identAst) Checks whether the ast of typeTokenTypes.IDENTis used as left-hand side value.private booleanMagicNumberCheck.isMagicNumberExists(DetailAST ast, DetailAST constantDefAST) Is magic number somewhere at ast tree.private static booleanUnusedCatchParameterShouldBeUnnamedCheck.isMethodInvocation(DetailAST identAst) Check if the givenTokenTypes.IDENTis a child of a dot operator and is a candidate for catch parameter.private static booleanUnusedLambdaParameterShouldBeUnnamedCheck.isMethodInvocation(DetailAST identAst) Check if the givenTokenTypes.IDENTis a child of a dot operator and is a candidate for lambda parameter.private static booleanFinalLocalVariableCheck.isMultipleTypeCatch(DetailAST parameterDefAst) Check if given parameter definition is a multiple type catch.private static booleanDefaultComesLastCheck.isNextSiblingOf(DetailAST ast, int tokenType) Return true only if passed tokenType in argument is found or returns false.private static booleanUnusedLocalVariableCheck.isNonLocalTypeDeclaration(DetailAST typeDeclAst) Whether a type declaration is non-local.private static booleanUnnecessaryNullCheckWithInstanceOfCheck.isNotEqual(DetailAST node) Checks if the given AST node represents a!=(not equal) operator.private static booleanUnnecessaryNullCheckWithInstanceOfCheck.isNullCheckRedundant(DetailAST instanceOfIdent, DetailAST nullCheckNode) Determines if the null check is redundant with the instanceof check.private static booleanUnnecessaryNullCheckWithInstanceOfCheck.isNullLiteral(DetailAST node) Checks if the given AST node is a null literal.private static booleanEqualsHashCodeCheck.isObjectParam(DetailAST paramNode) Determines if an AST is a formal param of type Object.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, without any parameters.private static booleanUnusedLocalVariableCheck.isPrivateInstanceVariable(DetailAST varDefAst) Whether instance variable or class variable have private access modifier.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 booleanOneStatementPerLineCheck.isResource(DetailAST ast) Checks that given node is a resource.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 static booleanUnnecessarySemicolonAfterTypeMemberDeclarationCheck.isSemicolon(DetailAST ast) Checks thatastis a semicolon.private booleanHiddenFieldCheck.isSetterMethod(DetailAST aMethodAST, 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 booleanWhenShouldBeUsedCheck.isSingleIfWithNoElse(DetailAST statement) Check if the case block statement is a single if statement with no else branch.private static booleanExplicitInitializationCheck.isSkipCase(DetailAST ast) Checks for cases that should be skipped: no assignment, local variable, final variables.private static booleanUnusedLocalVariableCheck.isStandAloneIncrementOrDecrement(DetailAST identAst) Checks whether the ast of typeTokenTypes.IDENTis used as an operand of a stand-alone increment or decrement.private static booleanIllegalTypeCheck.isStarImport(DetailAST importAst) Checks if current import is star import.private booleanEqualsAvoidNullCheck.isStringFieldOrVariable(DetailAST objCalledOn) Whether the field or the variable is of String type.private booleanEqualsAvoidNullCheck.isStringFieldOrVariableFromClass(DetailAST objCalledOn, 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 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 static booleanMissingSwitchDefaultCheck.isSwitchExpression(DetailAST ast) Checks if this LITERAL_SWITCH token is part of a switch expression.private booleanFallThroughCheck.isTerminated(DetailAST ast, boolean useBreak, boolean useContinue, Set<String> labelsForCurrentSwitchScope) Checks if a given subtree terminated by return, throw or, if allowed break, continue.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 booleanChecks if given node contains numeric constant for zero.private static booleanExplicitInitializationCheck.isZeroChar(DetailAST exprStart) Examine char literal for initializing to default value.private voidUnusedLocalVariableCheck.iterateOverBlockContainingLocalAnonInnerClass(DetailAST ast, Deque<UnusedLocalVariableCheck.VariableDesc> variablesStack) Iterate over all the ast nodes present underast.private voidChecks 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.leaveLiteralNew(DetailAST ast) Determine whether LITERAL_NEW is an anonymous class definition and leave the frame it is in.private voidEqualsAvoidNullCheck.leaveSlist(DetailAST ast) Determine whether SLIST begins a block, determined by braces.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) voidRequireThisCheck.leaveToken(DetailAST ast) voidReturnCountCheck.leaveToken(DetailAST ast) voidUnnecessaryParenthesesCheck.leaveToken(DetailAST ast) voidUnusedCatchParameterShouldBeUnnamedCheck.leaveToken(DetailAST ast) voidUnusedLambdaParameterShouldBeUnnamedCheck.leaveToken(DetailAST ast) voidUnusedLocalVariableCheck.leaveToken(DetailAST ast) private voidRequireThisCheck.logViolation(String msgKey, DetailAST ast, RequireThisCheck.AbstractFrame frame) Helper method to log a Violation.private voidUnusedLocalVariableCheck.logViolations(DetailAST scopeAst, Deque<UnusedLocalVariableCheck.VariableDesc> variablesStack) TraversevariablesStackstack and log the violations.private voidUnusedLocalVariableCheck.modifyVariablesStack(UnusedLocalVariableCheck.TypeDeclDesc obtainedClass, Deque<UnusedLocalVariableCheck.VariableDesc> variablesStack, DetailAST literalNewAst) Add non-private instance and class variables of the super class of the anonymous class to the variables stack.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 a block, determined by braces, 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.VariableDeclarationUsageDistanceCheck.searchVariableUsageExpressions(DetailAST variableAst, DetailAST statementAst) Searches variable usages starting from specified statement.private static DetailASTPatternVariableAssignmentCheck.shiftToNextTraversedBranch(DetailAST ast, DetailAST boundAst) Shifts once to the next possible branch within traverse trajectory.private booleanFinalLocalVariableCheck.shouldCheckEnhancedForLoopVariable(DetailAST ast) Determines whether enhanced for-loop variable should be checked or not.private booleanMagicNumberCheck.shouldCheckFieldDeclaration(DetailAST ast) Checks if the given AST node is a field declaration and should be checked.private booleanMagicNumberCheck.shouldCheckHashCodeMethod(DetailAST ast) Checks if the given AST node is a HashCode Method and should be checked.private static booleanUnusedLocalVariableCheck.shouldCheckIdentTokenNestedUnderDot(DetailAST dotAst) Whether to check identifier token nested under dotAst.private booleanFinalLocalVariableCheck.shouldCheckUnnamedVariable(DetailAST ast) Determines whether unnamed 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 booleanMagicNumberCheck.shouldTestAnnotationArgs(DetailAST ast) Checks if ast is annotation argument and should be checked.private booleanMagicNumberCheck.shouldTestAnnotationDefaults(DetailAST ast) Checks if ast is annotation element default value and should be checked.private static booleanFinalLocalVariableCheck.shouldUpdateUninitializedVariables(DetailAST ast) If there is anelsefollowing or token is CASE_GROUP or SWITCH_RULE and there is anothercasefollowing, then update the uninitialized variables.private booleanUnusedLocalVariableCheck.skipUnnamedVariables(DetailAST varDefAst) Check for skip currentTokenTypes.VARIABLE_DEFdue to allowUnnamedVariable option.private static DetailASTEqualsAvoidNullCheck.skipVariableAssign(DetailAST currentAST) Skips over an inner assign portion of an argument expression.private static DetailASTPatternVariableAssignmentCheck.traverseUntilNeededBranchType(DetailAST startingBranch, DetailAST bound, int neededTokenType) Traverses along the AST tree to locate the first branch of certain token type.private static booleanUnnecessaryParenthesesCheck.unnecessaryParenAroundOperators(DetailAST ast) Checks if conditional, relational, bitwise binary operator, unary and postfix operators in expressions are surrounded by unnecessary parentheses.private voidExplicitInitializationCheck.validateNonObjects(DetailAST ast) Checks for explicit initializations made to 'false', '0' and '\0'.private static voidUnusedLocalVariableCheck.visitDotToken(DetailAST dotAst, Deque<UnusedLocalVariableCheck.VariableDesc> variablesStack) Visit ast of typeTokenTypes.DOT.private static voidUnusedLocalVariableCheck.visitIdentToken(DetailAST identAst, Deque<UnusedLocalVariableCheck.VariableDesc> variablesStack) Visit ast of typeTokenTypes.IDENT.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.visitLambda(DetailAST lambdaAst) Creates new set of parameters and store old one in stack.private voidParameterAssignmentCheck.visitLambdaParameters(DetailAST ast) Creates new parameter set for given lambda expression.private voidUnusedLocalVariableCheck.visitLocalAnonInnerClass(DetailAST literalNewAst) Visit the local anon inner class.private voidIllegalTypeCheck.visitMethodCallOrRef(DetailAST methodCallOrRef) Checks the type arguments of given method call/reference.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 voidUnusedLocalVariableCheck.visitNonLocalTypeDeclarationToken(DetailAST typeDeclAst) Visit the non-local type declaration token.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 voidParameterAssignmentCheck.visitParameters(DetailAST parametersAst) Visits parameter list and adds parameter names to the set.private voidReturnCountCheck.visitReturn(DetailAST ast) Examines the return statement and tells context about it.voidAbstractSuperCheck.visitToken(DetailAST ast) voidArrayTrailingCommaCheck.visitToken(DetailAST arrayInit) voidAvoidDoubleBraceInitializationCheck.visitToken(DetailAST ast) voidAvoidInlineConditionalsCheck.visitToken(DetailAST ast) voidAvoidNoArgumentSuperConstructorCallCheck.visitToken(DetailAST ast) voidConstructorsDeclarationGroupingCheck.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) voidMissingNullCaseInSwitchCheck.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) voidNoArrayTrailingCommaCheck.visitToken(DetailAST arrayInit) voidNoCloneCheck.visitToken(DetailAST ast) voidNoEnumTrailingCommaCheck.visitToken(DetailAST detailAST) voidNoFinalizerCheck.visitToken(DetailAST ast) voidOneStatementPerLineCheck.visitToken(DetailAST ast) voidOverloadMethodsDeclarationOrderCheck.visitToken(DetailAST ast) voidPackageDeclarationCheck.visitToken(DetailAST ast) voidParameterAssignmentCheck.visitToken(DetailAST ast) voidPatternVariableAssignmentCheck.visitToken(DetailAST ast) voidRequireThisCheck.visitToken(DetailAST ast) voidReturnCountCheck.visitToken(DetailAST ast) voidSimplifyBooleanExpressionCheck.visitToken(DetailAST ast) voidSimplifyBooleanReturnCheck.visitToken(DetailAST ast) voidStringLiteralEqualityCheck.visitToken(DetailAST ast) voidUnnecessaryNullCheckWithInstanceOfCheck.visitToken(DetailAST instanceofNode) voidUnnecessaryParenthesesCheck.visitToken(DetailAST ast) voidUnnecessarySemicolonAfterOuterTypeDeclarationCheck.visitToken(DetailAST ast) voidUnnecessarySemicolonAfterTypeMemberDeclarationCheck.visitToken(DetailAST ast) voidUnnecessarySemicolonInEnumerationCheck.visitToken(DetailAST ast) voidUnnecessarySemicolonInTryWithResourcesCheck.visitToken(DetailAST ast) voidUnusedCatchParameterShouldBeUnnamedCheck.visitToken(DetailAST ast) voidUnusedLambdaParameterShouldBeUnnamedCheck.visitToken(DetailAST ast) voidUnusedLocalVariableCheck.visitToken(DetailAST ast) voidVariableDeclarationUsageDistanceCheck.visitToken(DetailAST ast) voidWhenShouldBeUsedCheck.visitToken(DetailAST ast) private voidIllegalTypeCheck.visitTypeDef(DetailAST typeDef) Checks the super type and implemented interfaces of a given type.private voidIllegalTypeCheck.visitVariableDef(DetailAST variableDef) Checks type of given variable.private voidUnusedLocalVariableCheck.visitVariableDefToken(DetailAST varDefAst) Visit ast of typeTokenTypes.VARIABLE_DEF.Method parameters in com.puppycrawl.tools.checkstyle.checks.coding with type arguments of type DetailASTModifier and TypeMethodDescriptionprotected booleanRequireThisCheck.AbstractFrame.containsFieldOrVariableDef(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(Set<DetailAST> set, DetailAST ident) Whether the set contains a method definition with the same name and number of parameters.private voidFinalLocalVariableCheck.updateUninitializedVariables(Deque<DetailAST> scopeUninitializedVariableData) Update current scope data uninitialized variable according to the specific scope data.Constructors in com.puppycrawl.tools.checkstyle.checks.coding with parameters of type DetailASTModifierConstructorDescriptionprotectedAbstractFrame(RequireThisCheck.AbstractFrame parent, DetailAST ident) Constructor -- invocable only via super() from subclasses.protectedBlockFrame(RequireThisCheck.AbstractFrame parent, DetailAST ident) Creates block frame.protectedCatchFrame(RequireThisCheck.AbstractFrame parent, DetailAST ident) Creates catch frame.privateCatchParameterDetails(DetailAST enclosingCatchClause) Create a new catch parameter instance.privateClassFrame(RequireThisCheck.AbstractFrame parent, DetailAST ident) Creates new instance of ClassFrame.protectedConstructorFrame(RequireThisCheck.AbstractFrame parent, DetailAST ident) Creates a constructor frame.privateFinalVariableCandidate(DetailAST variableIdent) Creates new instance.protectedForFrame(RequireThisCheck.AbstractFrame parent, DetailAST ident) Creates for frame.privateLambdaParameterDetails(DetailAST enclosingLambda, DetailAST identifierAst) Create a new lambda parameter instance.protectedMethodFrame(RequireThisCheck.AbstractFrame parent, DetailAST ident) Creates method frame.privateMethodNode(DetailAST ast) Constructs a stack node for a method definition.protectedTryWithResourcesFrame(RequireThisCheck.AbstractFrame parent, DetailAST ident) Creates try-with-resources frame.privateTypeDeclDesc(String qualifiedName, int depth, DetailAST typeDeclAst) Create a new TypeDeclDesc instance.privateVariableDesc(String name, DetailAST scope) Create a new VariableDesc instance.privateVariableDesc(String name, DetailAST typeAst, DetailAST scope) Create a new VariableDesc instance. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.design
Fields in com.puppycrawl.tools.checkstyle.checks.design declared as DetailASTModifier and TypeFieldDescriptionprivate final DetailASTHideUtilityClassConstructorCheck.Details.astClass ast.private final DetailASTFinalClassCheck.TypeDeclarationDescription.typeDeclarationAstType declaration ast node.Fields in com.puppycrawl.tools.checkstyle.checks.design with type parameters of type DetailASTModifier and TypeFieldDescriptionFinalClassCheck.anonInnerClassToOuterTypeDeclMaps anonymous inner class'sTokenTypes.LITERAL_NEWnode to the outer type declaration's fully qualified name.Methods in com.puppycrawl.tools.checkstyle.checks.design that return DetailASTModifier and TypeMethodDescriptionprivate 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).protected DetailASTFinalClassCheck.TypeDeclarationDescription.getTypeDeclarationAst()Get the type declaration ast node.Methods in com.puppycrawl.tools.checkstyle.checks.design with parameters of type DetailASTModifier and TypeMethodDescriptionvoidvoidvoidprivate booleanDesignForExtensionCheck.branchContainsJavadocComment(DetailAST token) Checks whether a javadoc comment exists under the token.private static 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 StringFinalClassCheck.extractQualifiedTypeName(DetailAST typeDeclarationAst) Extract the qualified type declaration name from given type declaration Ast.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 StringDesignForExtensionCheck.getAnnotationName(DetailAST annotation) Gets the name of the annotation.private static StringThrowsCountCheck.getAnnotationName(DetailAST annotation) Gets name of an annotation.private static StringVisibilityModifierCheck.getCanonicalName(DetailAST type) Gets canonical type's name from givenTYPEnode.private static DetailASTVisibilityModifierCheck.getGenericTypeArgs(DetailAST type, boolean isCanonicalName) Returns generic type arguments token.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 static StringFinalClassCheck.getSuperClassName(DetailAST classAst) Get super class name of given class.VisibilityModifierCheck.getTypeArgsClassNames(DetailAST typeArgs) Returns a list of type parameters class names.private static 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, Set<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 booleanDesignForExtensionCheck.hasJavadocCommentOnToken(DetailAST methodDef, int tokenType) Checks whether a token has a javadoc comment.private booleanVisibilityModifierCheck.hasProperAccessModifier(DetailAST variableDef, String variableName) Checks if current variable has proper access modifier according to Check's options.private booleanDesignForExtensionCheck.hasValidJavadocComment(DetailAST detailAST) Checks whether a javadoc contains the specified comment pattern that denotes a method as designed for extension.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, 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 static booleanDesignForExtensionCheck.isNativeMethod(DetailAST ast) Checks whether a method 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 booleanChecks if a type is public.private static booleanVisibilityModifierCheck.isStarImport(DetailAST importAst) Checks if current import is star import.private static booleanReturns true if given class is static or false.private static booleanVisibilityModifierCheck.isStaticFinalVariable(DetailAST variableDef) Checks whether variable has static final modifiers.private static booleanChecks if an AST node is a type definition.voidFinalClassCheck.leaveToken(DetailAST ast) voidInnerTypeLastCheck.leaveToken(DetailAST ast) voidMutableExceptionCheck.leaveToken(DetailAST ast) private voidFinalClassCheck.registerAnonymousInnerClassToSuperClass(DetailAST literalNewAst, String outerTypeDeclName) Register to the super class of anonymous inner class that the given class is instantiated by an anonymous inner class.private booleanHideUtilityClassConstructorCheck.shouldIgnoreClass(DetailAST ast) Checks if class is annotated by specific annotation(s) to skip.private voidFinalClassCheck.visitClass(DetailAST ast) Called to process a type definition.private voidMutableExceptionCheck.visitClassDef(DetailAST ast) Called when we start processing class definition.private voidCalled to process a constructor 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) voidOneTopLevelClassCheck.visitToken(DetailAST compilationUnit) voidSealedShouldHavePermitsListCheck.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 DetailASTModifierConstructorDescriptionprivateCreate a new ClassDesc instance.privateC-tor.privateTypeDeclarationDescription(String qualifiedName, int depth, DetailAST typeDeclarationAst) Create an instance of TypeDeclarationDescription. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.imports
Fields in com.puppycrawl.tools.checkstyle.checks.imports declared as DetailASTModifier and TypeFieldDescriptionprivate final DetailASTCustomImportOrderCheck.ImportDetails.importASTImport AST.Methods in com.puppycrawl.tools.checkstyle.checks.imports that return DetailASTModifier and TypeMethodDescriptionCustomImportOrderCheck.ImportDetails.getImportAST()Get import ast.Methods in com.puppycrawl.tools.checkstyle.checks.imports with parameters of type DetailASTModifier and TypeMethodDescriptionvoidvoidvoidvoidvoidprivate voidUnusedImportsCheck.collectReferencesFromJavadoc(DetailAST ast) Collects references made in Javadoc comments.private static StringCustomImportOrderCheck.createSamePackageRegexp(int firstPackageDomainsCount, DetailAST packageNode) Creates samePackageDomainsRegExp of the first package domains.private voidImportOrderCheck.doVisitToken(FullIdent ident, boolean isStatic, boolean previous, DetailAST ast) Shares processing...private voidImportOrderCheck.doVisitTokenInSameGroup(boolean isStatic, boolean previous, String name, DetailAST ast) Shares processing...voidCustomImportOrderCheck.finishTree(DetailAST rootAST) voidUnusedImportsCheck.finishTree(DetailAST rootAST) private static StringCustomImportOrderCheck.getFullImportIdent(DetailAST token) Forms import full path.private static StringImportControlCheck.getImportText(DetailAST ast) Returns import text.private static StringImportControlCheck.getPackageText(DetailAST ast) Returns package text.private static booleanUnusedImportsCheck.isQualifiedIdentifier(DetailAST ast) Checks whether ast is a fully qualified identifier.voidUnusedImportsCheck.leaveToken(DetailAST ast) private voidAvoidStarImportCheck.logsStarredImportViolation(DetailAST startingDot) Gets the full import identifier.private voidCustomImportOrderCheck.logWrongImportGroupOrder(DetailAST importAST, String importGroup, String currentGroupNumber, String fullImportIdent) Log wrong import group order.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) Constructors in com.puppycrawl.tools.checkstyle.checks.imports with parameters of type DetailASTModifierConstructorDescriptionprivateImportDetails(String importFullPath, String importGroup, boolean staticImport, DetailAST importAST) Initialise importFullPath, importGroup, staticImport, importAST. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.indentation
Fields in com.puppycrawl.tools.checkstyle.checks.indentation declared as DetailASTModifier and TypeFieldDescriptionprivate final DetailASTAbstractExpressionHandler.mainAstThe AST which is handled by this handler.private final DetailASTNewHandler.mainAstThe AST which is handled by this handler.Fields in com.puppycrawl.tools.checkstyle.checks.indentation with type parameters of type DetailASTModifier and TypeFieldDescriptionDetailAstSet.astLinesMaps line numbers to their ast.private final Map<DetailAST,AbstractExpressionHandler> HandlerFactory.createdHandlersCache for created method call handlers.Methods in com.puppycrawl.tools.checkstyle.checks.indentation that return DetailASTModifier and TypeMethodDescriptionprivate 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.DetailAstSet.firstLine()The first line in set of ast.DetailAstSet.getAst(int lineNum) Get the ast corresponding to line number.private static DetailASTMethodCallHandler.getCallLastNode(DetailAST firstNode) Returns method or constructor call right paren.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 static DetailASTAbstractExpressionHandler.getFirstAstNode(DetailAST ast) Get the first ast for given expression.private static DetailASTCommentsIndentationCheck.getFirstExpressionNodeFromMethodCall(DetailAST methodCall) Returns the first EXPR DetailAST child from parent of comment.static DetailASTAbstractExpressionHandler.getFirstToken(DetailAST ast) Searches in given subtree (including given node) for the token which represents first symbol for this subtree 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 DetailASTAnnotationArrayInitHandler.getLeftCurly()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()private DetailASTBlockParentHandler.getLeftParen()Get the left parenthesis portion of the expression we are handling.protected DetailASTAnnotationArrayInitHandler.getListChild()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 final DetailASTAbstractExpressionHandler.getMainAst()Accessor for the MainAst attribute.private static DetailASTMethodDefHandler.getMethodDefParamRightParen(DetailAST methodDefAst) Returns right parenthesis of method definition parameter list.private DetailASTMethodCallHandler.getMethodIdentAst()Returns method or constructor name.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 DetailASTDoWhileHandler.getNonListChild()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 DetailASTAnnotationArrayInitHandler.getRightCurly()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()private 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 DetailASTAnnotationArrayInitHandler.getTopLevelAst()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 DetailASTTryHandler.getTryResLparen()Method to find left parenthesis of try with resources.private DetailASTTryHandler.getTryResRparen()Method to find right parenthesis of try with resources.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 DetailASTModifier and TypeMethodDescriptionprivate NavigableMap<Integer,DetailAST> LineWrappingHandler.collectFirstNodes(DetailAST firstNode, DetailAST lastNode) Finds first nodes on line and puts them into Map.MemberDefHandler.getArrayInitNode(DetailAST firstNode) Finds the array init node.Methods in com.puppycrawl.tools.checkstyle.checks.indentation with parameters of type DetailASTModifier and TypeMethodDescriptionvoidAdd ast to the set of ast.private voidDetailAstSet.addLineWithAst(int lineNo, DetailAST ast) Map ast with their line number.private static booleanCommentsIndentationCheck.areInSameMethodCallWithSameIndent(DetailAST comment) Checks if the comment is inside a method call with same indentation of first expression. e.g: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.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.:voidprivate voidLineWrappingHandler.checkAnnotationIndentation(DetailAST atNode, NavigableMap<Integer, DetailAST> firstNodesOnLines, int indentLevel) Checks line wrapping into annotations.private voidTryHandler.checkChildIndentation(DetailAST ast, String subType, IndentLevel expectedIdent) Method to check indentation of try resources children.protected final 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 final voidAbstractExpressionHandler.checkExpressionSubtree(DetailAST tree, IndentLevel indentLevel, boolean firstLineMatches, boolean allowNesting) Check the indentation level for an expression subtree.static booleanLineWrappingHandler.checkForMethodLparenNewLine(DetailAST node) Checks whether the method lparen starts from a new line or not.static booleanLineWrappingHandler.checkForNullParameterChild(DetailAST node) Checks whether parameter node has any child or not.voidLineWrappingHandler.checkIndentation(DetailAST firstNode, DetailAST lastNode) Checks line wrapping into expressions and definitions using property 'lineWrappingIndentation'.private 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, LineWrappingHandler.LineWrappingOptions ignoreFirstLine) Checks line wrapping into expressions and definitions.protected final voidAbstractExpressionHandler.checkLeftParen(DetailAST lparen) Check the indentation of the left parenthesis.private voidAbstractExpressionHandler.checkLineIndent(DetailAST ast, IndentLevel indentLevel, boolean mustMatch) Check the indentation for a single-line.booleanNewHandler.checkNestedNew(DetailAST expression) Check if nestednewpresent.protected final voidAbstractExpressionHandler.checkRightParen(DetailAST lparen, DetailAST rparen) Check the indentation of the right parenthesis.private voidTryHandler.checkTryResources(DetailAST resourcesSpecAst) Checks indentation of resources parameters in try resources.private voidTryHandler.checkTryResParen(DetailAST parenAst, String subType) Method to check the indentation of left paren or right paren.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 NavigableMap<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 final intAbstractExpressionHandler.expandedTabsColumnNo(DetailAST ast) Get the column number for the start of a given expression, expanding tabs out into spaces in the process.protected final intDetailAstSet.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 final voidAbstractExpressionHandler.findSubtreeAst(DetailAstSet astSet, DetailAST tree, boolean allowNesting) Find the set of abstract syntax tree for a given subtree.private static DetailASTCommentsIndentationCheck.findTokenWhichBeginsTheLine(DetailAST root) Finds a token which begins the line.MemberDefHandler.getArrayInitNode(DetailAST firstNode) Finds the array init node.private static DetailASTMethodCallHandler.getCallLastNode(DetailAST firstNode) Returns method or constructor call right paren.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 static DetailASTAbstractExpressionHandler.getFirstAstNode(DetailAST ast) Get the first ast for given expression.private static DetailASTCommentsIndentationCheck.getFirstExpressionNodeFromMethodCall(DetailAST methodCall) Returns the first EXPR DetailAST child from parent of comment.protected static intAbstractExpressionHandler.getFirstLine(DetailAST tree) Get the first line number for given expression.static DetailASTAbstractExpressionHandler.getFirstToken(DetailAST ast) Searches in given subtree (including given node) for the token which represents first symbol for this subtree in file.private static DetailASTForHandler.getForLoopRightParen(DetailAST literalForAst) Returns right parenthesis of for-loop statement.HandlerFactory.getHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent) Get the handler for an AST.private static StringClassDefHandler.getHandlerName(DetailAST ast) Creates a handler name for this class according to ast type.private static 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 final 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 StringCommentsIndentationCheck.getMessageKey(DetailAST comment) Get a message key depending on a comment type.private static 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 IntegerLineWrappingHandler.getNextNodeLine(NavigableMap<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.voidIndentationCheck.indentationLog(DetailAST ast, String key, Object... args) Log a violation message.private static booleanCommentsIndentationCheck.isBlockStart(DetailAST root) Whether the AST node starts a block.private static booleanWhether 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 or 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 static 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 final booleanAbstractExpressionHandler.isOnStartOfLine(DetailAST ast) Determines if the given expression is at the start of a line.private static booleanLineWrappingHandler.isParentContainsTokenType(DetailAST node, int type) Checks that some parent of given node contains given token type.private booleanLambdaHandler.isSameLineAsSwitch(DetailAST node) Checks if the current LAMBDA node is placed on the same line as the given SWITCH_LITERAL node.private booleanSwitchRuleHandler.isSameLineAsSwitch(DetailAST node) Checks if the current SWITCH_RULE node is placed on the same line as the given SWITCH_LITERAL node.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.private static booleanSwitchHandler.isWrappingTrigger(DetailAST astNode) Checks if the given AST node represents a construct that typically causes line wrapping and therefore requires additional indentation level.voidIndentationCheck.leaveToken(DetailAST ast) private voidAbstractExpressionHandler.logChildError(DetailAST ast, int actualIndent, IndentLevel expectedIndent) Log child indentation error.protected final voidLog an indentation error.protected final voidAbstractExpressionHandler.logError(DetailAST ast, 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 booleanSwitchHandler.shouldIndentDueToWrapping(DetailAST directParent, DetailAST grandParent) Determines if indentation is needed due to line wrapping caused by intermediate nodes between the current AST node and its enclosing handler node.private booleanLineWrappingHandler.shouldProcessTextBlockLiteral(DetailAST node) Checks whether indentation ofTEXT_BLOCK_LITERAL_ENDneeds to be checked.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 DetailASTModifier and TypeMethodDescriptionprivate voidLineWrappingHandler.checkAnnotationIndentation(DetailAST atNode, NavigableMap<Integer, DetailAST> firstNodesOnLines, int indentLevel) Checks line wrapping into annotations.voidLineWrappingHandler.checkForAnnotationIndentation(NavigableMap<Integer, DetailAST> firstNodesOnLines, int indentLevel) Checks for annotation indentation.private static IntegerLineWrappingHandler.getNextNodeLine(NavigableMap<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 DetailASTModifierConstructorDescriptionprotectedAbstractExpressionHandler(IndentationCheck indentCheck, String typeName, DetailAST expr, AbstractExpressionHandler parent) Construct an instance of this handler with the given indentation check, name, abstract syntax tree, and parent handler.AnnotationArrayInitHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent) Construct an instance of this handler with the given indentation check, 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, 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.SwitchRuleHandler(IndentationCheck indentCheck, DetailAST expr, 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.YieldHandler(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 DetailASTModifier and TypeFieldDescriptionprivate final DetailASTJavadocMethodCheck.ExceptionInfo.astAST node representing this exception.private DetailASTAbstractJavadocCheck.FileContext.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 DetailASTModifier and TypeMethodDescriptionprivate DetailASTJavadocMethodCheck.ExceptionInfo.getAst()Gets the AST node representing this exception.protected DetailASTAbstractJavadocCheck.getBlockCommentAst()Getter for block comment in Java language syntax tree.private static DetailASTJavadocMethodCheck.getFirstClassNameNode(DetailAST ast) Get node where class name of exception starts.private static DetailASTWriteTagCheck.getJavadoc(DetailAST ast) Retrieves the Javadoc comment associated with a given AST node.private static DetailASTJavadocMethodCheck.getRecordDef(DetailAST ast) Finds the nearest ancestor record definition node for the given AST node.Methods in com.puppycrawl.tools.checkstyle.checks.javadoc that return types with arguments of type DetailASTModifier and TypeMethodDescriptionJavadocMethodCheck.findTokensInAstByType(DetailAST root, int astType) Finds node of specified type among root children, siblings, siblings children on any deep level.JavadocMethodCheck.getParameters(DetailAST ast) Computes the parameter nodes for a method.JavadocMethodCheck.getRecordComponents(DetailAST recordDef) Retrieves the list of record components from a given record definition.Methods in com.puppycrawl.tools.checkstyle.checks.javadoc with parameters of type DetailASTModifier and TypeMethodDescriptionfinal voidprivate 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 voidJavadocTypeCheck.checkComponentParamTag(DetailAST ast, Collection<JavadocTag> tags, String recordComponentName) Verifies that a record definition has the specified param tag for the specified record component name.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(List<JavadocTag> tags, DetailAST parent, boolean reportExpectedTags) Checks a set of tags for matching parameters.private voidJavadocMethodCheck.checkRecordParamTags(List<JavadocTag> tags, DetailAST compactDef, boolean reportExpectedTags) Checks if all record components in a compact constructor have corresponding@paramtags.private voidJavadocTypeCheck.checkTag(DetailAST ast, Iterable<JavadocTag> tags, String tagName, Pattern formatPattern) Verifies that a type definition has a required tag.private voidJavadocTypeCheck.checkTypeParamTag(DetailAST ast, Collection<JavadocTag> tags, String typeParamName) Verifies that a type definition has the specified param tag for the specified type parameter name.private static intWriteTagCheck.countCommentLines(DetailAST blockComment) Counts the number of lines in a block comment.JavadocMethodCheck.findTokensInAstByType(DetailAST root, int astType) Finds node of specified type among root children, siblings, siblings children on any deep level.final voidAbstractJavadocCheck.finishTree(DetailAST rootAST) static AccessModifierOptionJavadocVariableCheck.getAccessModifierFromModifiersTokenWithPrivateEnumSupport(DetailAST ast) A derivative ofCheckUtil.getAccessModifierFromModifiersToken(DetailAST)that considers enum definitions' visibility when evaluating the accessibility of an enum constant.private static JavadocMethodCheck.ExceptionInfoJavadocMethodCheck.getExceptionInfo(DetailAST ast) Get ExceptionInfo instance.private static DetailASTJavadocMethodCheck.getFirstClassNameNode(DetailAST ast) Get node where class name of exception starts.private static DetailASTWriteTagCheck.getJavadoc(DetailAST ast) Retrieves the Javadoc comment associated with a given AST node.private static intMissingJavadocMethodCheck.getMethodsNumberOfLine(DetailAST methodDef) Some javadoc.JavadocMethodCheck.getParameters(DetailAST ast) Computes the parameter nodes for a method.private static intAtclauseOrderCheck.getParentType(DetailAST commentBlock) Returns type of parent node.JavadocTypeCheck.getRecordComponentNames(DetailAST node) Collects the record components in a record definition.JavadocMethodCheck.getRecordComponents(DetailAST recordDef) Retrieves the list of record components from a given record definition.private static DetailASTJavadocMethodCheck.getRecordDef(DetailAST ast) Finds the nearest ancestor record definition node for the given AST node.private static List<JavadocMethodCheck.ExceptionInfo>JavadocMethodCheck.getThrowed(DetailAST methodAst) Get ExceptionInfo for all exceptions that throws in method code by 'throw new'.private static List<JavadocMethodCheck.ExceptionInfo>Computes the exception nodes for a method.private static booleanMissingJavadocPackageCheck.hasJavadoc(DetailAST ast) Checks that there is javadoc before ast.private static booleanMissingJavadocPackageCheck.hasJavadocAboveAnnotation(DetailAST ast) Checks javadoc existence in annotations list.private booleanJavadocMethodCheck.hasShortCircuitTag(DetailAST ast, List<JavadocTag> tags) Validates whether the Javadoc has a short circuit tag.private booleanMissingJavadocMethodCheck.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.static booleanMissingJavadocMethodCheck.isGetterMethod(DetailAST ast) Returns whether an AST represents a getter method.private booleanDecides whether the variable name of an AST is in the ignore list.private static booleanJavadocMethodCheck.isInIgnoreBlock(DetailAST methodBodyAst, DetailAST throwAst) Checks if a 'throw' usage is contained within a block that should be ignored.private static booleanChecks that ast is a javadoc comment.private booleanMissingJavadocMethodCheck.isMissingJavadocAllowed(DetailAST ast) Checks if a missing Javadoc is allowed by the check's configuration.private static booleanJavadocContentLocationCheck.isMultilineComment(DetailAST node) Checks if a DetailAST of typeTokenTypes.BLOCK_COMMENT_BEGINspan more than one line.static booleanMissingJavadocMethodCheck.isSetterMethod(DetailAST ast) Returns whether an AST represents a setter method.private static booleanSingleLineJavadocCheck.isSingleLineJavadoc(DetailAST blockCommentStart) Checks if comment is single-line comment.abstract booleanChecks if a particular Javadoc tag is valid within a Javadoc block of a given AST.private booleanMissingJavadocMethodCheck.matchesSkipRegex(DetailAST methodDef) Checks if the given method name matches the regex.private voidJavadocMethodCheck.processAST(DetailAST ast) Called to process an AST when visiting it.private booleanJavadocMethodCheck.shouldCheck(DetailAST ast) 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.private booleanMissingJavadocMethodCheck.shouldCheck(DetailAST ast, Scope nodeScope) Whether we should check this node.private booleanMissingJavadocTypeCheck.shouldCheck(DetailAST ast) Whether we should check this node.final voidAbstractJavadocCheck.visitToken(DetailAST blockCommentNode) voidInvalidJavadocPositionCheck.visitToken(DetailAST ast) voidJavadocContentLocationCheck.visitToken(DetailAST ast) final voidJavadocMethodCheck.visitToken(DetailAST ast) voidJavadocStyleCheck.visitToken(DetailAST ast) voidJavadocTypeCheck.visitToken(DetailAST ast) voidJavadocVariableCheck.visitToken(DetailAST ast) final voidMissingJavadocMethodCheck.visitToken(DetailAST ast) voidMissingJavadocPackageCheck.visitToken(DetailAST ast) voidMissingJavadocTypeCheck.visitToken(DetailAST ast) voidWriteTagCheck.visitToken(DetailAST ast) Method parameters in com.puppycrawl.tools.checkstyle.checks.javadoc with type arguments of type DetailASTModifier and TypeMethodDescriptionprivate static booleanJavadocMethodCheck.removeMatchingParam(Iterable<DetailAST> params, String paramName) Remove parameter from params collection by name.private static booleanJavadocMethodCheck.searchMatchingTypeParameter(Iterable<DetailAST> typeParams, String requiredTypeName) Returns true if required type found in type parameters.Constructors in com.puppycrawl.tools.checkstyle.checks.javadoc with parameters of type DetailASTModifierConstructorDescriptionprivateExceptionInfo(DetailAST ast, JavadocMethodCheck.ClassInfo classInfo) Creates new instance forFullIdent. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.metrics
Fields in com.puppycrawl.tools.checkstyle.checks.metrics declared as DetailASTModifier and TypeFieldDescriptionprivate final DetailASTAbstractClassCouplingCheck.ClassContext.classAstAST of class definition.Methods in com.puppycrawl.tools.checkstyle.checks.metrics that return DetailASTModifier and TypeMethodDescriptionprivate 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 DetailASTModifier and TypeMethodDescriptionprivate voidAbstractClassCouplingCheck.ClassContext.addReferencedClassName(DetailAST ast) Adds new referenced class.final voidvoidvoidvoidBooleanExpressionComplexityCheck.Context.checkCount(DetailAST ast) Checks if we violate maximum allowed complexity.private static intNPathComplexityCheck.countCaseConstants(DetailAST ast) Counts number of case constants tokens in a switch labeled rule.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 operator, for a token.private voidAbstractClassCouplingCheck.createNewClassContext(String className, DetailAST ast) Creates new inner class context with given name and location.voidJavaNCSSCheck.finishTree(DetailAST rootAST) private static DetailASTNPathComplexityCheck.getLastToken(DetailAST ast) Finds a leaf, which is the most distant from the root.booleanChecks 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 voidRestores previous context.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) voidBooleanExpressionComplexityCheck.leaveToken(DetailAST ast) voidCyclomaticComplexityCheck.leaveToken(DetailAST ast) voidJavaNCSSCheck.leaveToken(DetailAST ast) voidNPathComplexityCheck.leaveToken(DetailAST ast) private voidAbstractClassCouplingCheck.registerImport(DetailAST imp) Registers given import.voidSets end coordinates from given token.private voidAbstractClassCouplingCheck.visitAnnotationType(DetailAST annotationAST) Visit ANNOTATION literal and get its type to referenced classes of context.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.private voidAbstractClassCouplingCheck.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.private voidAbstractClassCouplingCheck.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) voidBooleanExpressionComplexityCheck.visitToken(DetailAST ast) voidCyclomaticComplexityCheck.visitToken(DetailAST ast) voidJavaNCSSCheck.visitToken(DetailAST ast) voidNPathComplexityCheck.visitToken(DetailAST ast) private voidCyclomaticComplexityCheck.visitTokenHook(DetailAST ast) Hook called when visiting a token.voidVisits type.private voidVisits type token for the current class context.private voidNPathComplexityCheck.visitUnitaryOperator(DetailAST ast, int basicBranchingFactor) Visits ternary operator (?private voidNPathComplexityCheck.visitWhenExpression(DetailAST ast, int basicBranchingFactor) Visits when expression token.Constructors in com.puppycrawl.tools.checkstyle.checks.metrics with parameters of type DetailASTModifierConstructorDescriptionprivateClassContext(String className, DetailAST ast) Create new context associated with given class. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.modifier
Methods in com.puppycrawl.tools.checkstyle.checks.modifier that return DetailASTModifier and TypeMethodDescriptionprivate static DetailASTModifierOrderCheck.checkOrderSuggestedByJls(List<DetailAST> modifiers) Checks if the modifiers were added in the order suggested in the Java language specification.private static DetailASTModifierOrderCheck.skipAnnotations(Iterator<DetailAST> modifierIterator) Skip all annotations in modifier block.Methods in com.puppycrawl.tools.checkstyle.checks.modifier that return types with arguments of type DetailASTModifier and TypeMethodDescriptionRedundantModifierCheck.getMethodAnnotationsList(DetailAST methodDef) Gets the list of annotations on method definition.Methods in com.puppycrawl.tools.checkstyle.checks.modifier with parameters of type DetailASTModifier and TypeMethodDescriptionprivate voidRedundantModifierCheck.checkClassConstructorModifiers(DetailAST classCtorAst) Check if class constructor has proper modifiers.private voidRedundantModifierCheck.checkConstructorModifiers(DetailAST ctorDefAst) Check modifiers of constructor.private voidRedundantModifierCheck.checkEnumConstructorModifiers(DetailAST ast) Check if enum constructor has proper modifiers.private voidRedundantModifierCheck.checkForRedundantModifier(DetailAST ast, int... modifierTypes) Checks if given ast has a redundant modifier.private voidRedundantModifierCheck.checkInterfaceModifiers(DetailAST ast) Checks if interface has proper modifiers.private voidRedundantModifierCheck.checkUnnamedVariables(DetailAST ast) Check if the variable is unnamed and has redundant final modifier.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 static booleanClassMemberImpliedModifierCheck.isInTypeBlock(DetailAST ast) Checks if ast is in a class, enum, anon class or record block.private static booleanRedundantModifierCheck.isUnnamedVariable(DetailAST ast) Check if the variable is unnamed.private voidRedundantModifierCheck.processAbstractMethodParameters(DetailAST ast) Process validation of parameters for Methods with no definition.private voidInterfaceMemberImpliedModifierCheck.processField(DetailAST ast) Check field in interface.private voidRedundantModifierCheck.processInterfaceOrAnnotation(DetailAST ast) Do validation of interface of annotation.private voidRedundantModifierCheck.processLambdaParameters(DetailAST lambdaAst) Process lambda parameters.private voidInterfaceMemberImpliedModifierCheck.processMethod(DetailAST ast) Check method in interface.private voidRedundantModifierCheck.processMethods(DetailAST ast) Process validation of Methods.private voidInterfaceMemberImpliedModifierCheck.processNestedType(DetailAST ast) Check nested types in interface.private voidRedundantModifierCheck.processResources(DetailAST ast) Checks if given resource has redundant modifiers.voidClassMemberImpliedModifierCheck.visitToken(DetailAST ast) voidInterfaceMemberImpliedModifierCheck.visitToken(DetailAST ast) voidModifierOrderCheck.visitToken(DetailAST ast) voidRedundantModifierCheck.visitToken(DetailAST ast) Method parameters in com.puppycrawl.tools.checkstyle.checks.modifier with type arguments of type DetailASTModifier and TypeMethodDescriptionprivate static DetailASTModifierOrderCheck.checkOrderSuggestedByJls(List<DetailAST> modifiers) Checks if the modifiers were added in the order suggested in the Java language specification.private static DetailASTModifierOrderCheck.skipAnnotations(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 DetailASTModifier and TypeMethodDescriptionAbbreviationAsWordInNameCheck.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 DetailASTModifier and TypeMethodDescriptionAbbreviationAsWordInNameCheck.getChildren(DetailAST node) Gets all the children which are one level below on the current DetailAST parent node.private booleanAbbreviationAsWordInNameCheck.hasIgnoredModifiers(DetailAST modifiers) Checks if a variable is to be ignored based on its modifiers.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.private static booleanChecks if given modifiers has public access.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 booleanCatchParameterNameCheck.mustCheckName(DetailAST ast) protected final booleanClassTypeParameterNameCheck.mustCheckName(DetailAST ast) protected final booleanConstantNameCheck.mustCheckName(DetailAST ast) protected booleanIllegalIdentifierNameCheck.mustCheckName(DetailAST ast) protected final booleanInterfaceTypeParameterNameCheck.mustCheckName(DetailAST ast) protected booleanLambdaParameterNameCheck.mustCheckName(DetailAST ast) protected final booleanLocalFinalVariableNameCheck.mustCheckName(DetailAST ast) protected final booleanLocalVariableNameCheck.mustCheckName(DetailAST ast) protected final booleanMemberNameCheck.mustCheckName(DetailAST ast) protected final booleanMethodTypeParameterNameCheck.mustCheckName(DetailAST ast) protected booleanParameterNameCheck.mustCheckName(DetailAST ast) protected final booleanPatternVariableNameCheck.mustCheckName(DetailAST ast) protected final booleanRecordComponentNameCheck.mustCheckName(DetailAST ast) protected final booleanRecordTypeParameterNameCheck.mustCheckName(DetailAST ast) protected final 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) voidLambdaParameterNameCheck.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 -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.sizes
Fields in com.puppycrawl.tools.checkstyle.checks.sizes declared as DetailASTModifier and TypeFieldDescriptionprivate final DetailASTExecutableStatementCountCheck.Context.astMember AST node.private final DetailASTMethodCountCheck.MethodCounter.scopeDefinitionThe surrounding scope definition (class, enum, etc.) which the method counts are connected to.Methods in com.puppycrawl.tools.checkstyle.checks.sizes that return DetailASTModifier and TypeMethodDescriptionExecutableStatementCountCheck.Context.getAST()Gets the member AST node.private DetailASTMethodCountCheck.MethodCounter.getScopeDefinition()Returns the surrounding scope definition (class, enum, etc.) which the method counts are connected to.Methods in com.puppycrawl.tools.checkstyle.checks.sizes with parameters of type DetailASTModifier and TypeMethodDescriptionvoidvoidprivate voidMethodCountCheck.checkCounters(MethodCountCheck.MethodCounter counter, DetailAST ast) Check the counters and report violations.private voidUtility for reporting if a maximum has been exceeded.private static intRecordComponentNumberCheck.countComponents(DetailAST recordComponents) Method to count the number of record components in this record definition.private static intMethodLengthCheck.countUsedLines(DetailAST ast) Count number of used code lines without comments.voidOuterTypeNumberCheck.finishTree(DetailAST ast) private static intLambdaBodyLengthCheck.getFirstNodeLineNumber(DetailAST lambdaBody) Get first child node in the tree line number.private static intLambdaBodyLengthCheck.getLastNodeLineNumber(DetailAST lambdaBody) Get last child node in the tree line number.private static intGet length of lambda body.private static intMethodLengthCheck.getLengthOfBlock(DetailAST openingBrace, DetailAST closingBrace) Returns length of code.private booleanParameterNumberCheck.isAnnotatedByIgnoredAnnotations(DetailAST ast) Checks if method or constructor is annotated by ignored annotation(s).private static booleanExecutableStatementCountCheck.isContainerNode(DetailAST node) Check if the node is of type ctor (compact or canonical), instance/ static initializer, method definition or lambda.private booleanParameterNumberCheck.isIgnoredOverriddenMethod(DetailAST ast) Checks if method is overridden and should be ignored.private booleanMethodCountCheck.isInLatestScopeDefinition(DetailAST methodDef) Checks if there is a scope definition to check and that the method is found inside that scope (class, enum, etc.).private voidExecutableStatementCountCheck.leaveContainerNode(DetailAST ast) Process the end of a container node.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.private voidExecutableStatementCountCheck.visitContainerNode(DetailAST ast) Process the start of the container node.private voidExecutableStatementCountCheck.visitSlist(DetailAST ast) Process the end of a statement list.voidAnonInnerLengthCheck.visitToken(DetailAST ast) voidExecutableStatementCountCheck.visitToken(DetailAST ast) voidLambdaBodyLengthCheck.visitToken(DetailAST ast) voidMethodCountCheck.visitToken(DetailAST ast) voidMethodLengthCheck.visitToken(DetailAST ast) voidOuterTypeNumberCheck.visitToken(DetailAST ast) voidParameterNumberCheck.visitToken(DetailAST ast) voidRecordComponentNumberCheck.visitToken(DetailAST ast) Constructors in com.puppycrawl.tools.checkstyle.checks.sizes with parameters of type DetailASTModifierConstructorDescriptionprivateCreates new member context.privateMethodCounter(DetailAST scopeDefinition) Creates an interface. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.checks.whitespace
Methods in com.puppycrawl.tools.checkstyle.checks.whitespace that return DetailASTModifier and TypeMethodDescriptionprivate static DetailASTOperatorWrapCheck.adjustParens(DetailAST node, UnaryOperator<DetailAST> step) Finds matching parentheses among siblings.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.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 DetailASTEmptyLineSeparatorCheck.getLastElementBeforeEmptyLines(DetailAST ast, int line) Returns the element after which empty lines exist.private static DetailASTOperatorWrapCheck.getLeftNode(DetailAST node) Returns the left neighbour of a binary operator.private static DetailASTNoWhitespaceAfterCheck.getPreviousElementOfMultiDimArray(DetailAST leftBracket) Gets the previous element of a second or higher dimension of an array declaration or initialization.private static DetailASTNoWhitespaceAfterCheck.getPreviousNodeWithParentOfTypeAst(DetailAST ast, DetailAST parent) Finds previous node by text order for an array declarator, which parent type isTYPE.private static DetailASTOperatorWrapCheck.getRightNode(DetailAST node) Returns the right neighbour of a binary operator.private static DetailASTNoWhitespaceAfterCheck.getTypeLastNode(DetailAST ast) Searches parameter node for a type node.private static DetailASTEmptyLineSeparatorCheck.getViolationAstForPackage(DetailAST ast) Gets the Ast on which violation is to be given for package declaration.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 that return types with arguments of type DetailASTModifier and TypeMethodDescriptionEmptyLineSeparatorCheck.findCommentUnder(DetailAST packageDef) Finds comment in next sibling of given packageDef.EmptyLineSeparatorCheck.getPostFixNode(DetailAST ast) Gets postfix Node from AST if present.NoWhitespaceAfterCheck.getPrecedingDot(DetailAST leftBracket) Gets the dot preceding a class member array index operation or class reference.NoWhitespaceAfterCheck.getReferencedClassDot(DetailAST leftBracket) Gets the dot preceding a class reference.Methods in com.puppycrawl.tools.checkstyle.checks.whitespace with parameters of type DetailASTModifier and TypeMethodDescriptionprivate static DetailASTOperatorWrapCheck.adjustParens(DetailAST node, UnaryOperator<DetailAST> step) Finds matching parentheses among siblings.voidvoidprivate voidEmptyLineSeparatorCheck.checkCommentInModifiers(DetailAST packageDef) Checks that packageDef token is separated from comment in modifiers.private voidEmptyLineSeparatorCheck.checkComments(DetailAST token) Check if group of comments located right before token has more than one previous empty line.private voidEmptyLineSeparatorCheck.checkCommentsInsideToken(DetailAST token) Check if group of comments located at the start of token has more than one previous empty line.private voidEmptyLineSeparatorCheck.checkToken(DetailAST ast, DetailAST nextToken) Checks that token and next token are separated.EmptyLineSeparatorCheck.findCommentUnder(DetailAST packageDef) Finds comment in next sibling of given packageDef.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).EmptyLineSeparatorCheck.getEmptyLines(DetailAST ast) Get list of empty lines.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 intNoWhitespaceBeforeCaseDefaultColonCheck.getLastColumnNumberOf(DetailAST ast) Returns the last column number of an ast.private static DetailASTEmptyLineSeparatorCheck.getLastElementBeforeEmptyLines(DetailAST ast, int line) Returns the element after which empty lines exist.private static DetailASTOperatorWrapCheck.getLeftNode(DetailAST node) Returns the left neighbour of a binary operator.private static intNoWhitespaceAfterCheck.getPositionAfter(DetailAST ast) Gets position after token (place of possible redundant whitespace).EmptyLineSeparatorCheck.getPostFixNode(DetailAST ast) Gets postfix Node from AST if present.NoWhitespaceAfterCheck.getPrecedingDot(DetailAST leftBracket) Gets the dot preceding a class member array index operation or class reference.private static DetailASTNoWhitespaceAfterCheck.getPreviousElementOfMultiDimArray(DetailAST leftBracket) Gets the previous element of a second or higher dimension of an array declaration or initialization.private static DetailASTNoWhitespaceAfterCheck.getPreviousNodeWithParentOfTypeAst(DetailAST ast, DetailAST parent) Finds previous node by text order for an array declarator, which parent type isTYPE.NoWhitespaceAfterCheck.getReferencedClassDot(DetailAST leftBracket) Gets the dot preceding a class reference.private static DetailASTOperatorWrapCheck.getRightNode(DetailAST node) Returns the right neighbour of a binary operator.private static DetailASTNoWhitespaceAfterCheck.getTypeLastNode(DetailAST ast) Searches parameter node for a type node.private static DetailASTEmptyLineSeparatorCheck.getViolationAstForPackage(DetailAST ast) Gets the Ast on which violation is to be given for package declaration.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 an 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 static booleanParenPadCheck.hasPrecedingSemiColon(DetailAST ast) Checks that a token is preceded by a semicolon.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 booleanOperatorWrapCheck.isAssignToVariable(DetailAST node) Checks if a node isTokenTypes.ASSIGNto a variable or resource.private static booleanOperatorWrapCheck.isColonFromLabel(DetailAST node) Checks if a node isTokenTypes.COLONfrom a label, switch case of default.private booleanEmptyLineSeparatorCheck.isCommentInBeginningOfLine(DetailAST comment) Check if token is comment, which starting in beginning of line.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.isEmptyCtorBlockCheckedFromRcurly(DetailAST ast) Test if the givenDetailASTis part of an allowed empty constructor (ctor) block checked from RCURLY.private booleanWhitespaceAroundCheck.isEmptyCtorBlockCheckedFromSlist(DetailAST ast) Test if the givenDetailASTis a part of an allowed empty constructor checked from SLIST token.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 booleanWhitespaceAroundCheck.isEmptySwitchBlockStatement(DetailAST ast) Tests if the givenDetailAstis part of an allowed empty switch case or default block.private static booleanWhitespaceAroundCheck.isEmptyType(DetailAST ast) Test if the givenDetailASTis part of an empty block.private static booleanOperatorWrapCheck.isEndOfLineModeViolation(DetailAST ast) Checks whether operator violatesWrapOption.EOLmode.private static booleanWhitespaceAfterCheck.isFollowedByWhitespace(DetailAST targetAST, int... 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.isGenericAfterNew(DetailAST ast) Checks if generic is afterLITERAL_NEW.private static booleanGenericWhitespaceCheck.isGenericBeforeCtorInvocation(DetailAST ast) Checks if generic is before constructor invocation.private static booleanGenericWhitespaceCheck.isGenericBeforeMethod(DetailAST ast) Is generic before method reference.private static booleanGenericWhitespaceCheck.isGenericBeforeRecordHeader(DetailAST ast) Checks if generic is before record header.private static booleanNoWhitespaceBeforeCheck.isInEmptyForInitializerOrCondition(DetailAST semicolonAst) Checks that semicolon is in empty for initializer or condition.private static booleanOperatorWrapCheck.isInPatternDefinition(DetailAST node) Ascends AST to determine if given node is part of a pattern definition.private static booleanNoWhitespaceBeforeCaseDefaultColonCheck.isInSwitch(DetailAST colonAst) Checks if the colon is inside a switch block.private static booleanParenPadCheck.isInTypecast(DetailAST ast) Checks whetherTokenTypes.RPARENis a closing paren of aTokenTypes.TYPECAST.private static booleanEmptyLineSeparatorCheck.isLineEmptyAfterPackage(DetailAST ast) Checks if there is another element at next line of package declaration.private static booleanOperatorWrapCheck.isNewLineModeViolation(DetailAST ast) Checks whether operator violatesWrapOption.NLmode.private booleanWhitespaceAroundCheck.isNotRelevantSituation(DetailAST ast, int currentType) Is ast not a target of Check.private static booleanNoWhitespaceBeforeCaseDefaultColonCheck.isOnDifferentLineWithPreviousToken(DetailAST colonAst) Checks if the colon is on same line as of case or default.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 booleanOperatorWrapCheck.isTargetNode(DetailAST node) Filters some false tokens that this check should ignore.private static booleanEmptyLineSeparatorCheck.isTokenNotOnPreviousSiblingLines(DetailAST token, DetailAST parentToken) Checks if token is not placed on the realm of previous sibling of token's parent.private booleanEmptyLineSeparatorCheck.isTwoPrecedingPreviousLinesFromCommentEmpty(DetailAST token) Checks if token has two preceding lines empty, starting from its describing comment.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 static booleanNoWhitespaceBeforeCaseDefaultColonCheck.isWhiteSpaceBeforeColon(DetailAST colonAst) Checks if there is a whitespace before the colon of a switch case or switch default.private static booleanNoWhitespaceBeforeCaseDefaultColonCheck.isWhitespaceBeforeColonOfCase(DetailAST colonAst) Checks if there is a whitespace before the colon of a switch case.private static booleanNoWhitespaceBeforeCaseDefaultColonCheck.isWhitespaceBeforeColonOfDefault(DetailAST colonAst) Checks if there is a whitespace before the colon of a switch default.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) 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, int[] 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, int[] 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 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 static booleanNoWhitespaceAfterCheck.shouldCheckWhitespaceAfter(DetailAST ast) Returns whether whitespace after a visited node should be checked.private voidSingleSpaceSeparatorCheck.visitEachToken(DetailAST node) Examines every sibling and child ofnodefor violations.private voidParenPadCheck.visitLiteralFor(DetailAST ast) Checks parens inTokenTypes.LITERAL_FOR.private voidParenPadCheck.visitResourceSpecification(DetailAST ast) Checks parens inTokenTypes.RESOURCE_SPECIFICATION.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) voidNoWhitespaceBeforeCaseDefaultColonCheck.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.Method parameters in com.puppycrawl.tools.checkstyle.checks.whitespace with type arguments of type DetailASTModifier and TypeMethodDescriptionprivate static DetailASTOperatorWrapCheck.adjustParens(DetailAST node, UnaryOperator<DetailAST> step) Finds matching parentheses among siblings. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.gui
Fields in com.puppycrawl.tools.checkstyle.gui declared as DetailASTModifier and TypeFieldDescriptionprivate DetailASTParseTreeTablePresentation.rootThe root node of the tree table model.Fields in com.puppycrawl.tools.checkstyle.gui with type parameters of type DetailASTModifier and TypeFieldDescriptionprivate final Map<DetailAST,DetailNode> ParseTreeTablePresentation.blockCommentToJavadocTreeCache to store already parsed Javadoc comments.Methods in com.puppycrawl.tools.checkstyle.gui with parameters of type DetailASTModifier and TypeMethodDescriptionprivate voidTreeTable.expandTreeTableByPath(DetailAST node) Expands path in tree table to given node so that user can see the node.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 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 static ObjectParseTreeTablePresentation.getValueAtDetailAST(DetailAST ast, int column) Gets a value for DetailAST object.private static DetailNodeParseTreeTablePresentation.parseJavadocTree(DetailAST blockComment) Parses Javadoc (DetailNode) tree of specified block comments.protected final voidParseTreeTableModel.setParseTree(DetailAST parseTree) Sets parse tree.protected final voidSet parse tree.Method parameters in com.puppycrawl.tools.checkstyle.gui with type arguments of type DetailASTModifier and TypeMethodDescriptionprivate static StringTreeTable.getAllMatchingXpathQueriesText(Deque<DetailAST> nodes) Generates a String with all matching XPath queries separated by newlines.private voidTreeTable.updateTreeTable(String xpath, Deque<DetailAST> nodes) Updates the Treetable by expanding paths in the tree and highlighting associated code.Constructors in com.puppycrawl.tools.checkstyle.gui with parameters of type DetailASTModifierConstructorDescriptionCodeSelectorPresentation(DetailAST ast, List<Integer> lines2position) Constructor.ParseTreeTableModel(DetailAST parseTree) Initialise pModel.ParseTreeTablePresentation(DetailAST parseTree) Constructor initialise root node. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.site
Methods in com.puppycrawl.tools.checkstyle.site that return DetailASTModifier and TypeMethodDescriptionprivate static DetailASTClassAndPropertiesSettersJavadocScraper.getParentAst(DetailAST ast, int type) Get the parent node of the given type.Methods in com.puppycrawl.tools.checkstyle.site with parameters of type DetailASTModifier and TypeMethodDescriptionprivate static DetailASTClassAndPropertiesSettersJavadocScraper.getParentAst(DetailAST ast, int type) Get the parent node of the given type.private static booleanClassAndPropertiesSettersJavadocScraper.isMethodOfScrapedModule(DetailAST methodDef) Checks if the given method is a method of the module being scraped.private static booleanClassAndPropertiesSettersJavadocScraper.isSetterMethod(DetailAST ast) Returns whether an AST represents a setter method. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.utils
Methods in com.puppycrawl.tools.checkstyle.utils that return DetailASTModifier and TypeMethodDescriptionstatic DetailASTParserUtil.createBlockCommentNode(String content) Create block comment from string content.static DetailASTParserUtil.createBlockCommentNode(org.antlr.v4.runtime.CommonToken token) Create block comment from token.private static DetailASTAnnotationUtil.findFirstAnnotation(DetailAST ast, Predicate<DetailAST> predicate) Checks if the given AST is annotated with at least one annotation that matches the given predicate and returns the AST representing the first matching annotation.static DetailASTAnnotationUtil.getAnnotation(DetailAST ast, String annotation) Checks if the AST is annotated with the passed in annotation and returns the AST representing that annotation.static DetailASTAnnotationUtil.getAnnotationHolder(DetailAST ast) Gets the AST that holds a series of annotations for the potentially annotated AST.static DetailASTCheckUtil.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 DetailASTModifier and TypeMethodDescriptionTokenUtil.findFirstTokenByPredicate(DetailAST root, Predicate<DetailAST> predicate) CheckUtil.getTypeParameters(DetailAST node) Retrieves the type parameters to the node.Methods in com.puppycrawl.tools.checkstyle.utils with parameters of type DetailASTModifier and TypeMethodDescriptionstatic booleanTokenUtil.areOnSameLine(DetailAST ast1, DetailAST ast2) Determines if two ASTs are on the same line.static booleanAnnotationUtil.containsAnnotation(DetailAST ast) Checks if the AST is annotated with any annotation.static booleanAnnotationUtil.containsAnnotation(DetailAST ast, String annotation) Checks if the AST is annotated with the passed in annotation.static booleanAnnotationUtil.containsAnnotation(DetailAST ast, Set<String> annotations) Checks if the given AST element is annotated with any of the specified annotations.static List<AbstractNode>XpathUtil.createChildren(AbstractNode root, AbstractNode parent, DetailAST firstChild) Iterates siblings of the given node and creates new Xpath-nodes.static StringCheckUtil.extractQualifiedName(DetailAST ast) Get name of package and super class of anon inner class by concatenating the identifier values underTokenTypes.DOT.private static DetailASTAnnotationUtil.findFirstAnnotation(DetailAST ast, Predicate<DetailAST> predicate) Checks if the given AST is annotated with at least one annotation that matches the given predicate and returns the AST representing the first matching annotation.TokenUtil.findFirstTokenByPredicate(DetailAST root, Predicate<DetailAST> predicate) static voidTokenUtil.forEachChild(DetailAST root, int type, Consumer<DetailAST> action) Performs an action for each child ofDetailASTroot node which matches the given token type.static AccessModifierOptionCheckUtil.getAccessModifierFromModifiersToken(DetailAST ast) Returns the access modifier of the method/constructor at the specified AST.private static AccessModifierOptionCheckUtil.getAccessModifierFromModifiersTokenDirectly(DetailAST modifiersToken) ReturnsAccessModifierOptionbased on the information about access modifier taken from the given token of typeTokenTypes.MODIFIERS.static DetailASTAnnotationUtil.getAnnotation(DetailAST ast, String annotation) Checks if the AST is annotated with the passed in annotation and returns the AST representing that annotation.private static StringAnnotationUtil.getAnnotationFullIdent(DetailAST annotationNode) Gets the full ident text of the annotation AST.static DetailASTAnnotationUtil.getAnnotationHolder(DetailAST ast) Gets the AST that holds a series of annotations for the potentially annotated AST.static StringJavadocUtil.getBlockCommentContent(DetailAST blockCommentBegin) Gets content of block comment.static ScopeScopeUtil.getDeclaredScopeFromMods(DetailAST aMods) Returns theScopeexplicitly specified by the modifier set.private static ScopeScopeUtil.getDefaultScope(DetailAST ast) Returns the defaultScopefor aDetailAST.static DetailASTCheckUtil.getFirstNode(DetailAST node) Finds sub-node for given node minimal (line, column) pair.static StringJavadocUtil.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 ScopeReturns theScopefor a givenDetailAST.static ScopeScopeUtil.getScopeFromMods(DetailAST aMods) Returns theScopespecified by the modifier set.static StringCheckUtil.getShortNameOfAnonInnerClass(DetailAST literalNewAst) Get the short name of super class of anonymous inner class.static AccessModifierOptionCheckUtil.getSurroundingAccessModifier(DetailAST node) Returns the access modifier of the surrounding "block".static ScopeScopeUtil.getSurroundingScope(DetailAST node) Returns the scope of the surrounding "block".static StringXpathUtil.getTextAttributeValue(DetailAST ast) Returns content of the text attribute of the ast element.CheckUtil.getTypeParameterNames(DetailAST node) Retrieves the names of the type parameters to the node.CheckUtil.getTypeParameters(DetailAST node) Retrieves the type parameters to the node.static booleanAnnotationUtil.hasOverrideAnnotation(DetailAST ast) Checks if the AST is annotated withOverrideorjava.lang.Overrideannotation.static booleanCheckUtil.isBeforeInSource(DetailAST ast1, DetailAST ast2) Retrieves whether ast1 is located before ast2.static booleanScopeUtil.isClassFieldDef(DetailAST node) Determines whether a node is a class field definition.static booleanJavadocUtil.isCorrectJavadocPosition(DetailAST blockComment) Checks Javadoc comment it's in right place.static booleanCheckUtil.isEqualsMethod(DetailAST ast) Tests whether a method definition AST defines an equals covariant.static booleanScopeUtil.isInAnnotationBlock(DetailAST node) Returns whether a node is directly contained within an annotation block.static booleanScopeUtil.isInBlockOf(DetailAST node, int tokenType) Returns whether a node is directly contained within a specified block.static booleanScopeUtil.isInClassBlock(DetailAST node) Returns whether a node is directly contained within a class block.static booleanScopeUtil.isInCodeBlock(DetailAST node) Returns whether the scope of a node is restricted to a code block.static booleanScopeUtil.isInEnumBlock(DetailAST node) Returns whether a node is directly contained within an enum block.static booleanScopeUtil.isInInterfaceBlock(DetailAST node) Returns whether a node is directly contained within an interface block.static booleanScopeUtil.isInInterfaceOrAnnotationBlock(DetailAST node) Returns whether a node is directly contained within an interface or annotation block.static booleanScopeUtil.isInRecordBlock(DetailAST node) Returns whether a node is directly contained within a record block.static booleanChecks whether ast node is in a specific scope.static booleanJavadocUtil.isJavadocComment(DetailAST blockCommentBegin) Checks block comment content starts with '*' javadoc comment identifier.static booleanScopeUtil.isLocalVariableDef(DetailAST node) Determines whether a node is a local variable definition.static booleanCheckUtil.isNonVoidMethod(DetailAST methodDefAst) Checks whether a method is a not void one.static booleanDetermines if the AST belongs to the given types.static booleanBlockCommentPosition.isOnAnnotationDef(DetailAST blockComment) Node is on annotation definition.static booleanBlockCommentPosition.isOnAnnotationField(DetailAST blockComment) Node is on annotation field declaration.static booleanNode is on class definition.static booleanBlockCommentPosition.isOnCompactConstructor(DetailAST blockComment) Node is on compact constructor, note that we don't need to check for a plain token here, since a compact constructor must be public.static booleanBlockCommentPosition.isOnConstructor(DetailAST blockComment) Node is on constructor.static booleanNode is on enum definition.static booleanBlockCommentPosition.isOnEnumConstant(DetailAST blockComment) Node is on enum constant.static booleanNode is on field declaration.static booleanBlockCommentPosition.isOnInterface(DetailAST blockComment) Node is on interface definition.static booleanBlockCommentPosition.isOnMember(DetailAST blockComment) Node is on type member declaration.static booleanBlockCommentPosition.isOnMethod(DetailAST blockComment) Node is on method declaration.static booleanBlockCommentPosition.isOnPackage(DetailAST blockComment) Node is on package definition.private static booleanBlockCommentPosition.isOnPlainClassMember(DetailAST blockComment) 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.static booleanBlockCommentPosition.isOnRecord(DetailAST blockComment) Node is on record definition.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 booleanNode is on type definition.static booleanScopeUtil.isOuterMostType(DetailAST node) Returns whether a node is contained in the outermost type block.static booleanCheckUtil.isReceiverParameter(DetailAST parameterDefAst) Checks whether a parameter is a receiver.static booleanTokenUtil.isRootNode(DetailAST ast) Determines if given AST is a root node, i.e. if the type of the token we are checking isCOMPILATION_UNIT.static booleanXpathUtil.supportsTextAttribute(DetailAST ast) Checks, if specified node can have@textattribute.Method parameters in com.puppycrawl.tools.checkstyle.utils with type arguments of type DetailASTModifier and TypeMethodDescriptionprivate static DetailASTAnnotationUtil.findFirstAnnotation(DetailAST ast, Predicate<DetailAST> predicate) Checks if the given AST is annotated with at least one annotation that matches the given predicate and returns the AST representing the first matching annotation.TokenUtil.findFirstTokenByPredicate(DetailAST root, Predicate<DetailAST> predicate) static voidTokenUtil.forEachChild(DetailAST root, int type, Consumer<DetailAST> action) Performs an action for each child ofDetailASTroot node which matches the given token type. -
Uses of DetailAST in com.puppycrawl.tools.checkstyle.xpath
Fields in com.puppycrawl.tools.checkstyle.xpath declared as DetailASTModifier and TypeFieldDescriptionprivate final DetailASTElementNode.detailAstThe ast node.private final DetailASTRootNode.detailAstThe ast node.private final DetailASTXpathQueryGenerator.rootAstThe root ast.Methods in com.puppycrawl.tools.checkstyle.xpath that return DetailASTModifier and TypeMethodDescriptionprivate static DetailASTXpathQueryGenerator.findChildWithTextAttribute(DetailAST root) Returns childDetailAstelement of the given root, which has text attribute.private static DetailASTXpathQueryGenerator.findChildWithTextAttributeRecursively(DetailAST root) Returns childDetailAstelement of the given root, which has text attribute.ElementNode.getUnderlyingNode()Returns underlying node.RootNode.getUnderlyingNode()Returns underlying node.Methods in com.puppycrawl.tools.checkstyle.xpath that return types with arguments of type DetailASTModifier and TypeMethodDescriptionXpathQueryGenerator.getMatchingAstElements()Returns list of nodes matching defined line number, column number and token type.Methods in com.puppycrawl.tools.checkstyle.xpath with parameters of type DetailASTModifier and TypeMethodDescriptionprivate intXpathQueryGenerator.expandedTabColumn(DetailAST ast) Returns the column number with tabs expanded.private static DetailASTXpathQueryGenerator.findChildWithTextAttribute(DetailAST root) Returns childDetailAstelement of the given root, which has text attribute.private static DetailASTXpathQueryGenerator.findChildWithTextAttributeRecursively(DetailAST root) Returns childDetailAstelement of the given root, which has text attribute.private static intXpathQueryGenerator.findPositionAmongSiblings(DetailAST ast) Finds position of the ast element among siblings.static StringXpathQueryGenerator.generateXpathQuery(DetailAST ast) Returns full xpath query for given ast element.private static StringXpathQueryGenerator.getXpathQuery(DetailAST root, DetailAST ast) Returns relative xpath query for given ast element from root.private static booleanXpathQueryGenerator.hasAtLeastOneSiblingWithSameTokenType(DetailAST ast) Checks if the given ast element has uniqueTokenTypesamong siblings.private booleanXpathQueryGenerator.isMatchingByLineAndColumnAndTokenType(DetailAST ast) Checks if the givenDetailASTnode is matching line number, column number and token type.private static booleanXpathQueryGenerator.isXpathQueryForNodeIsAccurateEnough(DetailAST ast) Checks if ast element has all requirements to have unique xpath query.Constructors in com.puppycrawl.tools.checkstyle.xpath with parameters of type DetailASTModifierConstructorDescriptionElementNode(AbstractNode root, AbstractNode parent, DetailAST detailAst, int depth, int indexAmongSiblings) Creates a newElementNodeinstance.Creates a newRootNodeinstance.XpathQueryGenerator(DetailAST rootAst, int lineNumber, int columnNumber, int tokenType, FileText fileText, int tabWidth) Creates a newXpathQueryGeneratorinstance.XpathQueryGenerator(DetailAST rootAst, int lineNumber, int columnNumber, FileText fileText, int tabWidth) Creates a newXpathQueryGeneratorinstance.