This Maven module provides annotation processors that automatically generate code, such as serializers, walkers, etc. It is designed to run during the Java compilation phase and integrates seamlessly into the build process.
This annotation processor automatically generates efficient serializer classes for all types implementing the Message interface.
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 publicpublic 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.