JetBrains / JetBrains/java-annotations

Annotation for linking (generated) code

Aperta
#71 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Kotlin
Stelle
463
Fork
72
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Example Usecase: when defining a HTTP API and generating client code which maps to it it would be good to have the IDE be able to recognize this, in e.g. Dataflow Analysis.

```java
public class Controller {
@Get("/foo")
public String getFoo(String param) { return "foo " + param; }
}
```

```java
public class GeneratedControllerClient {
@Calls("org.example.Controller.getFoo(String)")
public String getFoo(String param) { /* do http call and return server result */ }
}
```

Optionally the generated client could have additional parameters, e.g. for a callback style invocation, and it would be possible to map e.g. return value of original method to some `Consumer` parameter of the call site.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.