Class TypeOutputtingChecker.Visitor

java.lang.Object
com.sun.source.util.TreeScanner<R,P>
com.sun.source.util.TreePathScanner<R,P>
All Implemented Interfaces:
com.sun.source.tree.TreeVisitor<Void,Void>
Enclosing class:
TypeOutputtingChecker

public static class TypeOutputtingChecker.Visitor extends BaseTypeVisitor<GenericAnnotatedTypeFactory<?,?,?,?>>
Prints the types of the class and all of its enclosing fields, methods, and inner classes.
  • Constructor Details

  • Method Details

    • processClassTree

      public void processClassTree(com.sun.source.tree.ClassTree node)
      Description copied from class: BaseTypeVisitor
      Type-check classTree. Subclasses should override this method instead of BaseTypeVisitor.visitClass(ClassTree, Void).
      Overrides:
      processClassTree in class BaseTypeVisitor<GenericAnnotatedTypeFactory<?,?,?,?>>
      Parameters:
      node - class to check
    • visitMethod

      public Void visitMethod(com.sun.source.tree.MethodTree node, Void p)
      Description copied from class: BaseTypeVisitor
      Checks that the method obeys override and subtype rules to all overridden methods. (Uses the pseudo-assignment logic to do so.)

      The override rule specifies that a method, m1, may override a method m2 only if:

      • m1 return type is a subtype of m2
      • m1 receiver type is a supertype of m2
      • m1 parameters are supertypes of corresponding m2 parameters
      Also, it issues a "missing.this" error for static method annotated receivers.
      Specified by:
      visitMethod in interface com.sun.source.tree.TreeVisitor<Void,Void>
      Overrides:
      visitMethod in class BaseTypeVisitor<GenericAnnotatedTypeFactory<?,?,?,?>>
    • visitVariable

      public Void visitVariable(com.sun.source.tree.VariableTree node, Void p)
      Specified by:
      visitVariable in interface com.sun.source.tree.TreeVisitor<Void,Void>
      Overrides:
      visitVariable in class BaseTypeVisitor<GenericAnnotatedTypeFactory<?,?,?,?>>