Class LocalClassScanner
java.lang.Object
com.sun.source.util.TreeScanner<Void,Integer>
com.sun.source.util.TreePathScanner<Void,Integer>
org.checkerframework.afu.annotator.scanner.LocalClassScanner
- All Implemented Interfaces:
TreeVisitor<Void,
Integer>
LocalClassScanner determines the index of a tree for a local class. If the index is i, it is the
ith local class with the class name in the file. Thus, if i = 2, it will have a name of the form
OuterClass$2InnerClass.
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
indexOfClassTree
(TreePath path, ClassTree localClass) Given a local class, computes and returns its 1-based index in the given tree representing a local class.visitBlock
(BlockTree node, Integer level) Methods inherited from class com.sun.source.util.TreePathScanner
getCurrentPath, scan, scan
Methods inherited from class com.sun.source.util.TreeScanner
reduce, scan, visitAnnotatedType, visitAnnotation, visitAnyPattern, visitArrayAccess, visitArrayType, visitAssert, visitAssignment, visitBinary, visitBindingPattern, visitBreak, visitCase, visitCatch, visitClass, 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, visitNewClass, 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 a local class, computes and returns its 1-based index in the given tree representing a local class.- Parameters:
path
- the source path ending in the local classlocalClass
- the local class to search for- Returns:
- the index of the local class in the source code
-
visitBlock
- Specified by:
visitBlock
in interfaceTreeVisitor<Void,
Integer> - Overrides:
visitBlock
in classTreeScanner<Void,
Integer>
-