Anybody know if in Java there´s something like Scala macro
to interact with the javac in compilation time. Reflection
it´s quite powerful, but only works on runtime.
Asked
Active
Viewed 159 times
0

paul
- 12,873
- 23
- 91
- 153
-
2A quick search on Google comes up with a definitive *NO*. Did your search fail? – Bob Dalgleish Oct 13 '17 at 23:34
-
I did not find anything. But it's hard to believe that java don't offer a similar feature being so powerful to create DSLs – paul Oct 14 '17 at 07:26
1 Answers
3
In Java there are no macros like in Scala but there is kind of macros like in C++.
Can I have macros in Java source files
There are also
Manifold http://manifold.systems/ https://github.com/manifold-systems/manifold
Spoon https://spoon.gforge.inria.fr/ https://github.com/INRIA/spoon
compile-time annotation processing Is there a way to create custom annotations in Scala and write a custom annotation processor to verify the annotations?
Lombok https://projectlombok.org/ https://github.com/projectlombok/lombok

Dmytro Mitin
- 48,194
- 3
- 28
- 66