checkers.typestate
Class StateAnnotationsDetector

java.lang.Object
  extended by com.sun.source.util.TreeScanner<R,P>
      extended by com.sun.source.util.TreePathScanner<java.lang.Void,java.util.Set<javax.lang.model.element.AnnotationMirror>>
          extended by checkers.typestate.StateAnnotationsDetector
All Implemented Interfaces:
com.sun.source.tree.TreeVisitor<java.lang.Void,java.util.Set<javax.lang.model.element.AnnotationMirror>>

public class StateAnnotationsDetector
extends com.sun.source.util.TreePathScanner<java.lang.Void,java.util.Set<javax.lang.model.element.AnnotationMirror>>

Detects all annotations annotated with State, used on any program element.

Author:
Adam Warski (adam at warski dot org)

Constructor Summary
StateAnnotationsDetector(javax.annotation.processing.ProcessingEnvironment env, TypestateUtil typestateUtil, checkers.types.AnnotatedTypeFactory factory)
           
 
Method Summary
 java.lang.Void visitAnnotation(com.sun.source.tree.AnnotationTree node, java.util.Set<javax.lang.model.element.AnnotationMirror> stateAnnotations)
           
 java.lang.Void visitMethod(com.sun.source.tree.MethodTree node, java.util.Set<javax.lang.model.element.AnnotationMirror> stateAnnotations)
           
 java.lang.Void visitMethodInvocation(com.sun.source.tree.MethodInvocationTree node, java.util.Set<javax.lang.model.element.AnnotationMirror> stateAnnotations)
           
 
Methods inherited from class com.sun.source.util.TreePathScanner
getCurrentPath, scan, scan
 
Methods inherited from class com.sun.source.util.TreeScanner
reduce, scan, visitAnnotatedType, visitArrayAccess, visitArrayType, visitAssert, visitAssignment, visitBinary, visitBlock, visitBreak, visitCase, visitCatch, visitClass, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitContinue, visitDoWhileLoop, visitEmptyStatement, visitEnhancedForLoop, visitErroneous, visitExpressionStatement, visitForLoop, visitIdentifier, visitIf, visitImport, visitInstanceOf, visitLabeledStatement, visitLiteral, visitMemberSelect, visitModifiers, visitNewArray, visitNewClass, visitOther, visitParameterizedType, visitParenthesized, visitPrimitiveType, visitReturn, visitSwitch, visitSynchronized, visitThrow, visitTry, visitTypeCast, visitTypeParameter, visitUnary, visitVariable, visitWhileLoop, visitWildcard
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StateAnnotationsDetector

public StateAnnotationsDetector(javax.annotation.processing.ProcessingEnvironment env,
                                TypestateUtil typestateUtil,
                                checkers.types.AnnotatedTypeFactory factory)
Method Detail

visitMethodInvocation

public java.lang.Void visitMethodInvocation(com.sun.source.tree.MethodInvocationTree node,
                                            java.util.Set<javax.lang.model.element.AnnotationMirror> stateAnnotations)
Specified by:
visitMethodInvocation in interface com.sun.source.tree.TreeVisitor<java.lang.Void,java.util.Set<javax.lang.model.element.AnnotationMirror>>
Overrides:
visitMethodInvocation in class com.sun.source.util.TreeScanner<java.lang.Void,java.util.Set<javax.lang.model.element.AnnotationMirror>>

visitMethod

public java.lang.Void visitMethod(com.sun.source.tree.MethodTree node,
                                  java.util.Set<javax.lang.model.element.AnnotationMirror> stateAnnotations)
Specified by:
visitMethod in interface com.sun.source.tree.TreeVisitor<java.lang.Void,java.util.Set<javax.lang.model.element.AnnotationMirror>>
Overrides:
visitMethod in class com.sun.source.util.TreeScanner<java.lang.Void,java.util.Set<javax.lang.model.element.AnnotationMirror>>

visitAnnotation

public java.lang.Void visitAnnotation(com.sun.source.tree.AnnotationTree node,
                                      java.util.Set<javax.lang.model.element.AnnotationMirror> stateAnnotations)
Specified by:
visitAnnotation in interface com.sun.source.tree.TreeVisitor<java.lang.Void,java.util.Set<javax.lang.model.element.AnnotationMirror>>
Overrides:
visitAnnotation in class com.sun.source.util.TreeScanner<java.lang.Void,java.util.Set<javax.lang.model.element.AnnotationMirror>>