We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/PoivronMax/idlize-cj-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
annotation.md•433 B
# 注解的使用
通过反射获取实例上注解的值。
代码如下:
<!-- verify -->
```cangjie
import std.reflect.*
main() {
let ti = TypeInfo.of(Test())
let annotation = ti.findAnnotation<A>()
if (let Some(a) <- annotation) {
println(a.name)
}
}
@A["Annotation"]
public class Test {}
@Annotation
public class A {
const A(let name: String) {}
}
```
运行结果:
```text
Annotation
```