我想创建一个java 注释,它在编译时生成一个方法,例如 Lombok:我有这个类:
@MyNewAnnotation()
public class ClassTest {
private String name;
private Integer id;
private String lastName;
public final static String COL_NAME = "NAME";
public final static String COL_LAST_NAME = "LAST_NAME";
}
Run Code Online (Sandbox Code Playgroud)
我希望 myNewAnnotation 可以生成getCol返回的方法,"NAME, LAST_NAME"例如:
public static String getCol() {
return COL_NAME + "," + COL_LAST_NAME;
}
Run Code Online (Sandbox Code Playgroud)
注释必须读取以“COL_”开头的所有属性,并在编译时生成新方法,或多或少类似于 Lombok 生成 getter 或 setter 时的情况
我正在学习如何使用 Spring Boot 和 Spring Cloud 来使用微服务。我在选择 spring cloud 和 boot 版本时遇到问题 - 我无法使用注释,@RibbonClient因为我还没有找到依赖项。
我想使用最新版本的 spring cloud 和 spring boot,但我没有找到功能区依赖项。我想使用spring boot 2.4.1和spring cloud 2.20.0.x。