checkers.types
Class TypeAnnotator

java.lang.Object
  extended by checkers.types.visitors.AnnotatedTypeScanner<Void,Void>
      extended by checkers.types.TypeAnnotator
All Implemented Interfaces:
AnnotatedTypeVisitor<Void,Void>

public class TypeAnnotator
extends AnnotatedTypeScanner<Void,Void>

Adds annotations to a type based on the contents of a type. By default, this class honors the ImplicitFor annotation and applies implicit annotations specified by ImplicitFor for any type whose visitor is not overridden or does not call super; it is designed to be invoked from AnnotatedTypeFactory.annotateImplicit(Element, AnnotatedTypeMirror) and AnnotatedTypeFactory.annotateImplicit(Tree, AnnotatedTypeMirror).

TypeAnnotator traverses types deeply by default, except that it skips the method receiver of executable types (for interoperability with AnnotatedTypeFactory.annotateInheritedFromClass(AnnotatedTypeMirror)).


Field Summary
 
Fields inherited from class checkers.types.visitors.AnnotatedTypeScanner
visitedNodes
 
Constructor Summary
TypeAnnotator(BaseTypeChecker checker)
          Creates a TypeAnnotator from the given checker, using that checker's TypeQualifiers annotation to determine the annotations that are in the type hierarchy.
 
Method Summary
protected  Void scan(AnnotatedTypeMirror type, Void p)
          Processes an element by calling e.accept(this, p); this method may be overridden by subclasses.
 Void visitExecutable(AnnotatedTypeMirror.AnnotatedExecutableType t, Void p)
          Visits an executable type.
 
Methods inherited from class checkers.types.visitors.AnnotatedTypeScanner
reduce, scan, scanAndReduce, scanAndReduce, visit, visit, visitArray, visitDeclared, visitNoType, visitNull, visitPrimitive, visitTypeVariable, visitWildcard
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeAnnotator

public TypeAnnotator(BaseTypeChecker checker)
Creates a TypeAnnotator from the given checker, using that checker's TypeQualifiers annotation to determine the annotations that are in the type hierarchy.

Parameters:
checker - the type checker to which this annotator belongs
Method Detail

scan

protected Void scan(AnnotatedTypeMirror type,
                    Void p)
Description copied from class: AnnotatedTypeScanner
Processes an element by calling e.accept(this, p); this method may be overridden by subclasses.

Overrides:
scan in class AnnotatedTypeScanner<Void,Void>
Returns:
the result of visiting type

visitExecutable

public Void visitExecutable(AnnotatedTypeMirror.AnnotatedExecutableType t,
                            Void p)
Description copied from interface: AnnotatedTypeVisitor
Visits an executable type.

Specified by:
visitExecutable in interface AnnotatedTypeVisitor<Void,Void>
Overrides:
visitExecutable in class AnnotatedTypeScanner<Void,Void>
Parameters:
t - the type to visit
p - a visitor-specified parameter
Returns:
a visitor-specified result