JetBrains / JetBrains/java-annotations
Annotation for linking (generated) code
- 主要语言
- 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 还没有评估数据。