Class Processor

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

    @AutoService(javax.annotation.processing.Processor.class)
    public class Processor
    extends javax.annotation.processing.AbstractProcessor
    Processor for the @FreeBuilder annotation.

    Processing is split into analysis (owned by the Analyser) and code generation (owned by the GeneratedBuilder), for testability.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Analyser analyser  
      private FeatureSet features  
      private static java.util.concurrent.ConcurrentMap<javax.annotation.processing.ProcessingEnvironment,​Processor> registeredProcessors
      Keep track of which processors have been registered to avoid double-processing if FreeBuilder ends up on the processor path twice.
      • Fields inherited from class javax.annotation.processing.AbstractProcessor

        processingEnv
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.util.Set<java.lang.String> getSupportedAnnotationTypes()  
      javax.lang.model.SourceVersion getSupportedSourceVersion()  
      int hashCode()  
      void init​(javax.annotation.processing.ProcessingEnvironment processingEnv)  
      boolean process​(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations, javax.annotation.processing.RoundEnvironment roundEnv)  
      • Methods inherited from class javax.annotation.processing.AbstractProcessor

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

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

      • registeredProcessors

        private static final java.util.concurrent.ConcurrentMap<javax.annotation.processing.ProcessingEnvironment,​Processor> registeredProcessors
        Keep track of which processors have been registered to avoid double-processing if FreeBuilder ends up on the processor path twice. While we catch the resulting Filer exceptions and convert them to warnings, it's still cleaner to issue a single NOTE-severity message.
    • Constructor Detail

      • Processor

        public Processor()
      • Processor

        public Processor​(FeatureSet features)
    • Method Detail

      • 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
      • 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 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
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object