Class AbstractGenerator

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

    public abstract class AbstractGenerator
    extends javax.annotation.processing.AbstractProcessor
    Extend this abstract processor to properly initalize and call templates.
    See Also:
    process()
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private EnvironmentState env  
      • 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 java.util.Set<javax.lang.model.element.TypeElement> annotations()  
      java.util.Set<java.lang.String> getSupportedAnnotationTypes()  
      javax.lang.model.SourceVersion getSupportedSourceVersion()  
      void init​(javax.annotation.processing.ProcessingEnvironment processingEnv)  
      protected void invoke​(Templates.Invokable invokable)  
      protected abstract void process()
      Override process method and call invoke(org.immutables.generator.Templates.Invokable) from inside it passing invokable fragments from generated template instances.
      boolean process​(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations, javax.annotation.processing.RoundEnvironment round)  
      protected javax.annotation.processing.ProcessingEnvironment processing()  
      protected javax.annotation.processing.RoundEnvironment round()  
      • 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
    • Constructor Detail

      • AbstractGenerator

        public AbstractGenerator()
    • Method Detail

      • processing

        protected final javax.annotation.processing.ProcessingEnvironment processing()
      • round

        protected final javax.annotation.processing.RoundEnvironment round()
      • annotations

        protected final java.util.Set<javax.lang.model.element.TypeElement> annotations()
      • getSupportedSourceVersion

        public javax.lang.model.SourceVersion getSupportedSourceVersion()
        Specified by:
        getSupportedSourceVersion in interface javax.annotation.processing.Processor
        Overrides:
        getSupportedSourceVersion 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
      • 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
      • process

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