-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.md.template
26 lines (14 loc) · 2.04 KB
/
README.md.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## ls-annotation
ls-annotation is a java bytecode decompiler; it extracts and prints definitions of classes, methods and fields that use java annotations.
The purpose of this tool is to make sense out of declarations with annotations that depend on one another, an example for this kind of dependencies is @Autowire from Spring Boot:
In Spring Boot a function that is marked with @Autowire will get the value returned by a function marked with the @Bean annotation, provided that this function
returns the same type or a derived class as that of the parameter type marked with @Autowire, and that the class with the Bean annotation is included in the @ComponentScan annotation.
The same mechanism is applied to constructor arguments of classe marked with the @Component annotation.
Now you can have some of the features of following up on annotations in IntelliJ, but this program is nice if you prefer to look at text.
The motivation for this tool is to extract all classes/methods that have an annotation - and do so based on the bytecode of a system. I think that searching through the bytecode is very effective way to look at complex java based systems; Searching through the source code is much more limited, often one is faced with the problem of chasing multiple dependencies and their versions (and one might have to do so across multiple source code repositories); one doesn't have this problem when looking at the complete binary byte code representation of a given system.
Limitations: this program can detect detect annotations placed into the byte code, it can detect annotations with retention policy CLASS and RUNTIME [link](https://docs.oracle.com/javase/7/docs/api/java/lang/annotation/RetentionPolicy.html). It can't detect annotations with retention policy SOURCE that are not put into bytecode, for example @Override is one of these.
## Installation
Download ls-annotation.jar from the [release page](https://github.com/MoserMichael/ls-annotations/releases/)
you need JDK version 8 to run this program.
## Usage
ls-annotation is a command line utility;