A tool for defining Java annotations in various Java APIs

I am trying to identify places where annotation names match or look like compiling a list of these things to make sure our team knows where to find possible confusion. For example, Guice @provides and RESTeasy @provider are quite similar to spelling, but in semantics they are different enough to confuse people, so I would like to clearly explain this and explain the differences.

What I'm looking for is a tool or even a website that lists annotations related to packages. This may be a dream, but before I start manually and collect these things, I thought I would check.

I was considering writing based on Javadoc, which simply inserted annotations, but in many cases I do not have access to the Java source files.

Any thoughts or suggestions?

+3
source share
3 answers

In Eclipse, you can use the standard “Search Links” method (context menu of the used Annotation LinksProject ), and you get a list where the annotations are used in your project.

+1
source

I suggest you scan annotations yourself and create a list for this.

You can do this by writing your own implementation of the annotation processor, i.e. continue with AbstractProcessor . Inside this processor, you can write a text file containing all the annotations. You can add this processor to your build procedure, then it will execute the processor when creating the project.

- Google Reflections. , .

+1

Why not scan your classpath and export all annotations used? Then just use a simple parsing / text analysis to see items with the same name?

0
source

Source: https://habr.com/ru/post/1784961/


All Articles