Package io.vavr.match
Class PatternsProcessor
- java.lang.Object
-
- javax.annotation.processing.AbstractProcessor
-
- io.vavr.match.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.
-
-
Constructor Summary
Constructors Constructor Description PatternsProcessor()
-
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)
-
-
-
Method Detail
-
getSupportedAnnotationTypes
public java.util.Set<java.lang.String> getSupportedAnnotationTypes()
- Specified by:
getSupportedAnnotationTypes
in interfacejavax.annotation.processing.Processor
- Overrides:
getSupportedAnnotationTypes
in classjavax.annotation.processing.AbstractProcessor
-
getSupportedSourceVersion
public javax.lang.model.SourceVersion getSupportedSourceVersion()
- Specified by:
getSupportedSourceVersion
in interfacejavax.annotation.processing.Processor
- Overrides:
getSupportedSourceVersion
in classjavax.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 interfacejavax.annotation.processing.Processor
- Specified by:
process
in classjavax.annotation.processing.AbstractProcessor
- Parameters:
annotations
- the annotation types requested to be processedroundEnv
- 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)
-
-