preferencebinder
preferencebinder copied to clipboard
Check for `PreferenceInjector.inject` call at compile time
It would improve UX to check that the user has properly called PreferenceInjector.inject
and PreferenceInjector.stopListening
(if necessary) in the target class if there are annotations present.
This may not actually be possible, especially when dealing with inheritance.
It turns out this is possible using java's Compiler Tree API. It has been implemented using a technique from this stackoverflow answer
This feature seems to have some compatibility issues. It really needs to work perfectly as it can cause unfixable compilation errors when it functions incorrectly.
I'm going to remove this feature pending extensive testing on a range of use cases and build cases.