Class AnonymousClassScanner
java.lang.Object
com.sun.source.util.TreeScanner<Void,Integer>
com.sun.source.util.TreePathScanner<Void,Integer>
org.checkerframework.afu.annotator.scanner.AnonymousClassScanner
- All Implemented Interfaces:
TreeVisitor<Void,Integer>
AnonymousClassScanner determine the index of a tree for an anonymous class. If the index is i, it
is the ith anonymous class in the file. Thus, if i = 2, it will have a name of the form
NamedClass$2.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intindexOfClassTree(TreePath path, Tree anonclass) Given an anonymous class, computes and returns its 1-based index in the given tree representing an anonymous class.visitClass(ClassTree node, Integer level) visitNewClass(NewClassTree node, Integer level) Methods inherited from class com.sun.source.util.TreePathScanner
getCurrentPath, scan, scanMethods inherited from class com.sun.source.util.TreeScanner
reduce, scan, visitAnnotatedType, visitAnnotation, visitAnyPattern, visitArrayAccess, visitArrayType, visitAssert, visitAssignment, visitBinary, visitBindingPattern, visitBlock, visitBreak, visitCase, visitCatch, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitConstantCaseLabel, visitContinue, visitDeconstructionPattern, visitDefaultCaseLabel, visitDoWhileLoop, visitEmptyStatement, visitEnhancedForLoop, visitErroneous, visitExports, visitExpressionStatement, visitForLoop, visitIdentifier, visitIf, visitImport, visitInstanceOf, visitIntersectionType, visitLabeledStatement, visitLambdaExpression, visitLiteral, visitMemberReference, visitMemberSelect, visitMethod, visitMethodInvocation, visitModifiers, visitModule, visitNewArray, visitOpens, visitOther, visitPackage, visitParameterizedType, visitParenthesized, visitPatternCaseLabel, visitPrimitiveType, visitProvides, visitRequires, visitReturn, visitStringTemplate, visitSwitch, visitSwitchExpression, visitSynchronized, visitThrow, visitTry, visitTypeCast, visitTypeParameter, visitUnary, visitUnionType, visitUses, visitVariable, visitWhileLoop, visitWildcard, visitYield
-
Method Details
-
indexOfClassTree
Given an anonymous class, computes and returns its 1-based index in the given tree representing an anonymous class.- Parameters:
path- the source path ending in the anonymous classanonclass- the anonymous class to search for- Returns:
- the index of the anonymous class in the source code
-
visitClass
- Specified by:
visitClassin interfaceTreeVisitor<Void,Integer> - Overrides:
visitClassin classTreeScanner<Void,Integer>
-
visitNewClass
- Specified by:
visitNewClassin interfaceTreeVisitor<Void,Integer> - Overrides:
visitNewClassin classTreeScanner<Void,Integer>
-