Annotation Type ProtoMessage


@Retention(CLASS) @Target(TYPE) public @interface ProtoMessage

Marks a POJO (or Java 17+ record) as a Protocol Buffers message. The Codename One Maven plugin scans every @ProtoMessage class at build time and emits a reflection-free ProtoCodec next to it that serializes / deserializes the class to / from the binary protobuf wire format. The generated cn1app.ProtoBootstrap registers every codec with ProtoCodecs so generated gRPC clients can resolve nested message types by class without reflection.

Each persistable field on the class must carry ProtoField with a unique tag. Field types may be: scalar (int / long / float / double / boolean / String / byte[]), other @ProtoMessage types, @ProtoEnum-marked enums, or java.util.List of any of the above (interpreted as repeated in proto3).

Mirrors the design of Mapped for JSON projection; you can carry both annotations on the same class to support JSON and protobuf wire formats off the same POJO.