Package io.vavr.match

Class PatternsProcessor

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

    public class PatternsProcessor
    extends javax.annotation.processing.AbstractProcessor
    A code generator for Vavr structural pattern matching patterns.

    Note:

    If javac complains [WARNING] No processor claimed any of these annotations: ... we need to provide the compiler arg -Xlint:-processing.

    See JDK-6999068 bug.

    • Field Summary

      • Fields inherited from class javax.annotation.processing.AbstractProcessor

        processingEnv
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.lang.String deriveClassName​(ClassModel classModel)  
      private void generate​(java.util.Set<ClassModel> classModels)  
      java.util.Set<java.lang.String> getSupportedAnnotationTypes()  
      javax.lang.model.SourceVersion getSupportedSourceVersion()  
      boolean process​(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations, javax.annotation.processing.RoundEnvironment roundEnv)
      Gathers annotated elements, transforms elements to a generator model and generates the model to code.
      private java.util.Set<ClassModel> transform​(java.util.Set<javax.lang.model.element.TypeElement> typeElements)  
      • Methods inherited from class javax.annotation.processing.AbstractProcessor

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

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

      • PatternsProcessor

        public PatternsProcessor()
    • 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
      • process

        public boolean process​(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations,
                               javax.annotation.processing.RoundEnvironment roundEnv)
        Gathers annotated elements, transforms elements to a generator model and generates the model to code.
        Specified by:
        process in interface javax.annotation.processing.Processor
        Specified by:
        process in class javax.annotation.processing.AbstractProcessor
        Parameters:
        annotations - the annotation types requested to be processed
        roundEnv - environment for information about the current and prior round
        Returns:
        whether or not the set of annotation types are claimed by this processor
      • transform

        private java.util.Set<ClassModel> transform​(java.util.Set<javax.lang.model.element.TypeElement> typeElements)
      • generate

        private void generate​(java.util.Set<ClassModel> classModels)
      • deriveClassName

        private java.lang.String deriveClassName​(ClassModel classModel)