Is there way to get properties files as strongly typed classes? I guess there are code generators but doing it with annotations would be much cooler.
What I mean is;
The Annotation Processing Tool (apt) cannot modify classes (though it can create new ones). In order to modify the class at compile time, you'd probably need to edit the AST (as Project Lombok does). The simplest approach would probably be to generate the classes and then use the generated library as a dependency for other code.
If you want to do it statically, its a code generation problem that may be solved quite easily (for each item in file, produce a new getXXX
method).
But if you want this at runtime, then you have the problem of having your code referencing method that did not exists at compile time; I don't think it can be done.
(Note that if you are looking for a project idead, the reverse, having an interface with accessor method and annotation, and an implementation generated at runtime, that relies on the annotated methods, can be done.)