An annotation processor for Geb!, the Generative Event Bus.
Find a file
2024-08-30 12:20:46 +02:00
.github/workflows ci: added github actions 2023-12-28 02:56:09 +01:00
gradle/wrapper chore: initial commit 2023-08-22 11:13:23 +02:00
src/main fix: avoid nullptr in generated code 2024-08-30 12:20:46 +02:00
.editorconfig chore: initial commit 2023-08-22 11:13:23 +02:00
.gitignore chore: initial commit 2023-08-22 11:13:23 +02:00
build.gradle fix: version bump + fix gitversion 2024-06-01 01:46:27 +02:00
gradlew chore: initial commit 2023-08-22 11:13:23 +02:00
gradlew.bat chore: initial commit 2023-08-22 11:13:23 +02:00
LICENSE chore: initial commit 2023-08-22 11:13:23 +02:00
README.md chore: readme update 2023-08-22 11:17:01 +02:00
settings.gradle chore: initial commit 2023-08-22 11:13:23 +02:00

Geb! Processor

This is the processor behind GEB's magic.

The trick

There is no trick, it's just basic metaprogramming.

Suppose that you have a simple event system, with annotated listeners receiving Event objects. To process something like this at runtime, you need to ask every class to subscribe to the bus, then iterate all of its methods to find the annotated ones to call.

That works, of course, but it's not that fast. Ah, if only you knew in advance, such as at compile time, who's going to get called with what... oh, wait, you do.

The processor then writes at compile time direct calls to all subscribers into the events, to take as little time as possible.