JetBrains / JetBrains/java-annotations

Annotation for linking (generated) code

未关闭
#71 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Kotlin
星标
463
派生
72
PR 合并指标
30 天内没有已合并 PR

描述

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.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。