Top Description Fields Constructors Methods
io.vavr.match

public Class PatternsProcessor

extends AbstractProcessor
Class Inheritance
Imports
io.vavr.match.annotation.Patterns, .Unapply, io.vavr.match.generator.Generator, io.vavr.match.model.ClassModel, .MethodModel, javax.annotation.processing.AbstractProcessor, .Filer, .Messager, .RoundEnvironment, javax.lang.model.SourceVersion, javax.lang.model.element.TypeElement, javax.tools.Diagnostic, java.io.IOException, .Writer, java.util.Collections, .HashSet, .List, .Set, java.util.stream.Collectors

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.

Author
Daniel Dietrich

Field Summary

Inherited from javax.annotation.processing.AbstractProcessor:
processingEnv

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private String
private void
generate(Set<ClassModel> classModels)

public Set<String>
public SourceVersion
public boolean

Returns:

whether or not the set of annotation types are claimed by this processor
process
(Set<? extends TypeElement>
the annotation types requested to be processed
annotations
,
RoundEnvironment
environment for information about the current and prior round
roundEnv
)

Implements abstract javax.annotation.processing.AbstractProcessor.process.

Implements javax.annotation.processing.Processor.process.

Gathers annotated elements, transforms elements to a generator model and generates the model to code.

private Set<ClassModel>
transform(Set<TypeElement> typeElements)

Inherited from javax.annotation.processing.AbstractProcessor:
getCompletionsgetSupportedOptionsinitisInitialized

Constructor Detail

PatternsProcessorback to summary
public PatternsProcessor()

Method Detail

deriveClassNameback to summary
private String deriveClassName(ClassModel classModel)
generateback to summary
private void generate(Set<ClassModel> classModels)
getSupportedAnnotationTypesback to summary
public Set<String> getSupportedAnnotationTypes()

Overrides javax.annotation.processing.AbstractProcessor.getSupportedAnnotationTypes.

Implements javax.annotation.processing.Processor.getSupportedAnnotationTypes.

Doc from javax.annotation.processing.AbstractProcessor.getSupportedAnnotationTypes.

Returns the names of the annotation interfaces supported by this processor.

Returns:Set<String>

the names of the annotation interfaces supported by this processor or an empty set if none

Annotations
@Override
getSupportedSourceVersionback to summary
public SourceVersion getSupportedSourceVersion()

Overrides javax.annotation.processing.AbstractProcessor.getSupportedSourceVersion.

Implements javax.annotation.processing.Processor.getSupportedSourceVersion.

Doc from javax.annotation.processing.AbstractProcessor.getSupportedSourceVersion.

Returns the latest source version supported by this annotation processor.

Returns:SourceVersion

the latest source version supported by this annotation processor

Annotations
@Override
processback to summary
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)

Implements abstract javax.annotation.processing.AbstractProcessor.process.

Implements javax.annotation.processing.Processor.process.

Gathers annotated elements, transforms elements to a generator model and generates the model to code.

Parameters
annotations:Set<? extends TypeElement>

the annotation types requested to be processed

roundEnv:RoundEnvironment

environment for information about the current and prior round

Returns:boolean

whether or not the set of annotation types are claimed by this processor

Annotations
@Override
transformback to summary
private Set<ClassModel> transform(Set<TypeElement> typeElements)