Class MessageProcessor

java.lang.Object
javax.annotation.processing.AbstractProcessor
pt.unl.fct.di.novasys.babel2.channels.MessageProcessor
All Implemented Interfaces:
Processor

@SupportedAnnotationTypes("pt.unl.fct.di.novasys.babel2.channels.BabelIPMessage") @SupportedSourceVersion(RELEASE_17) @AutoService(Processor.class) public class MessageProcessor extends AbstractProcessor
Compile-time annotation processor that generates binary serializer classes for every Java record annotated with BabelIPMessage.

For each annotated type the processor introspects the record's component accessor methods and emits a new class <RecordName>Serializer in the pt.unl.fct.di.novasys.babel2.channels.serializers package. The generated class:

The processor runs at SourceVersion.RELEASE_17 and targets the annotation type pt.unl.fct.di.novasys.babel2.channels.BabelIPMessage. It uses JavaPoet to construct the source files that are written via the standard Filer.

A compile-time error is reported (via Diagnostic.Kind.ERROR) if:

  • the annotated type is not a record;
  • a collection or map component lacks generic type arguments;
  • an unsupported type is encountered.