This Maven module provides an annotation processor that automatically generates efficient serializer classes for all types implementing the Message
interface. It is designed to run during the Java compilation phase and integrates seamlessly into build process.
The MessageProcessor
performs the following tasks:
Message
interface, a corresponding *Serializer
class is generated. This serializer includes writeTo
and readFrom
methods that support stateful message encoding and decoding.@Order
annotation on fields, ensuring fields are serialized in a defined and sequential order.@Order
have a corresponding pair of accessor methods:fieldName()
)fieldName(Type val)
)@Order
must be declared as public
public class MyMessage implements Message { @Order(0) private int id; public int id() { return id; } public void id(int id) { this.id = id; } }
At compile time, a class MyMessageSerializer
implemented MessageSerializer
will be generated with methods:
If the @Order
values are not sequential starting from 0, or if getter/setter method names do not match the field name, compilation will fail with a meaningful error message pointing to the problematic element.
To avoid a circular dependency between ignite-core
(which contains message classes) and ignite-codegen
(which needs to know about them), the annotation processor is temporarily placed in a separate module. This separation allows the processor to remain independent of core classes during compilation.
In the future, this structure may be consolidated when build system constraints are resolved.