Class AnnotationProcessorImpl

  • All Implemented Interfaces:
    javax.annotation.processing.Processor

    public class AnnotationProcessorImpl
    extends javax.annotation.processing.AbstractProcessor
    Annotation Processor to be invoked by javac. This class receives options from the Main method through system properties (ouch!).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String format  
      private javax.annotation.processing.Messager messenger  
      private java.io.File outDir  
      private java.util.Properties resource  
      private javax.lang.model.util.Types typeUtils  
      • Fields inherited from class javax.annotation.processing.AbstractProcessor

        processingEnv
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private AnnotationVisitor createAnnotationVisitor​(javax.lang.model.element.TypeElement te)  
      java.util.Set<java.lang.String> getSupportedAnnotationTypes()  
      javax.lang.model.SourceVersion getSupportedSourceVersion()  
      private java.lang.String getUsage​(Option o)  
      void init​(javax.annotation.processing.ProcessingEnvironment processingEnv)  
      private boolean isOptionHidden​(java.lang.String usage)  
      boolean process​(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations, javax.annotation.processing.RoundEnvironment roundEnv)  
      private void scan​(javax.lang.model.element.Element f, AnnotationVisitor visitor)  
      private void scan​(javax.lang.model.element.TypeElement decl, AnnotationVisitor visitor)  
      • Methods inherited from class javax.annotation.processing.AbstractProcessor

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

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

      • outDir

        private java.io.File outDir
      • format

        private java.lang.String format
      • resource

        private java.util.Properties resource
      • typeUtils

        private javax.lang.model.util.Types typeUtils
      • messenger

        private javax.annotation.processing.Messager messenger
    • Constructor Detail

      • AnnotationProcessorImpl

        public AnnotationProcessorImpl()
    • Method Detail

      • init

        public void init​(javax.annotation.processing.ProcessingEnvironment processingEnv)
        Specified by:
        init in interface javax.annotation.processing.Processor
        Overrides:
        init in class javax.annotation.processing.AbstractProcessor
      • getSupportedAnnotationTypes

        public java.util.Set<java.lang.String> getSupportedAnnotationTypes()
        Specified by:
        getSupportedAnnotationTypes in interface javax.annotation.processing.Processor
        Overrides:
        getSupportedAnnotationTypes in class javax.annotation.processing.AbstractProcessor
      • getSupportedSourceVersion

        public javax.lang.model.SourceVersion getSupportedSourceVersion()
        Specified by:
        getSupportedSourceVersion in interface javax.annotation.processing.Processor
        Overrides:
        getSupportedSourceVersion in class javax.annotation.processing.AbstractProcessor
      • createAnnotationVisitor

        private AnnotationVisitor createAnnotationVisitor​(javax.lang.model.element.TypeElement te)
                                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • scan

        private void scan​(javax.lang.model.element.TypeElement decl,
                          AnnotationVisitor visitor)
      • scan

        private void scan​(javax.lang.model.element.Element f,
                          AnnotationVisitor visitor)
      • isOptionHidden

        private boolean isOptionHidden​(java.lang.String usage)
      • getUsage

        private java.lang.String getUsage​(Option o)
      • process

        public boolean process​(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations,
                               javax.annotation.processing.RoundEnvironment roundEnv)
        Specified by:
        process in interface javax.annotation.processing.Processor
        Specified by:
        process in class javax.annotation.processing.AbstractProcessor