Class BasicTypeProcessor

  • All Implemented Interfaces:
    javax.annotation.processing.Processor
    Direct Known Subclasses:
    CFGProcessor

    public abstract class BasicTypeProcessor
    extends AbstractTypeProcessor
    Process the types in an AST in a trivial manner, with hooks for derived classes to actually do something.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected @MonotonicNonNull com.sun.source.tree.CompilationUnitTree currentRoot
      The source tree that's being scanned.
      • Fields inherited from class javax.annotation.processing.AbstractProcessor

        processingEnv
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract com.sun.source.util.TreePathScanner<?,​?> createTreePathScanner​(com.sun.source.tree.CompilationUnitTree root)
      Create a TreePathScanner at the given root.
      void typeProcess​(javax.lang.model.element.TypeElement e, com.sun.source.util.TreePath p)
      Visit the tree path for the type element.
      • Methods inherited from class javax.annotation.processing.AbstractProcessor

        getCompletions, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, isInitialized
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • currentRoot

        protected @MonotonicNonNull com.sun.source.tree.CompilationUnitTree currentRoot
        The source tree that's being scanned.
    • Constructor Detail

      • BasicTypeProcessor

        public BasicTypeProcessor()
    • Method Detail

      • createTreePathScanner

        protected abstract com.sun.source.util.TreePathScanner<?,​?> createTreePathScanner​(com.sun.source.tree.CompilationUnitTree root)
        Create a TreePathScanner at the given root.
        Parameters:
        root - where to start the tree traversal
        Returns:
        a TreePathScanner at the given root
      • typeProcess

        public void typeProcess​(javax.lang.model.element.TypeElement e,
                                com.sun.source.util.TreePath p)
        Visit the tree path for the type element.
        Specified by:
        typeProcess in class AbstractTypeProcessor
        Parameters:
        e - element of the analyzed class
        p - the tree path to the element, with the leaf being a ClassTree