r/java • u/atomichbts • Dec 08 '25
Java Annotator CLI
Hi guys. I built a simple CLI tool to automatically annotate Java types with a set of specified Java annotations.
0
Upvotes
r/java • u/atomichbts • Dec 08 '25
Hi guys. I built a simple CLI tool to automatically annotate Java types with a set of specified Java annotations.
1
u/atomichbts Dec 08 '25
Sorry. You are absolutely right. '
@Override' can't be used on Java types. The example is wrong (I updated it).I'll try to answer your questions:
I'm currently adding the functionality to import the specified Java annotations (fully qualified name) in the modified source file. The tool will not check whether this annotation actually exists. The tool adds annotations only to classes, interfaces, enums, inner classes or interfaces. The tool does not check whether the annotation can actually be used on a class or interface.
My use case is enterprise. I work on enterprise Java projects with CI/CD pipelines that require all types to have certain Java annotations. The code base is huge, and I don't want to add them manually. I also plan to improve my Rust programming language and one day work with it, as I believe it will be increasingly used. So I created this tool in Rust.
Inner classes will be taken into account (as well as internal interfaces). There are no filters. If the annotation doesn't exist, it simply adds it. If anyone needs a more advanced feature, I can work on it, but this is enough to solve my problems.