有没有办法获得像ConstructorProperties这样的注释,它@Target(CONSTRUCTOR)必须注释 java 16 记录的生成构造函数?例如:
@ConstructorProperties({"id", "filename"})
public record Person(long id, String filename) {}
Run Code Online (Sandbox Code Playgroud)
此 ^ 导致以下错误:
java: annotation type not applicable to this kind of declaration
Run Code Online (Sandbox Code Playgroud)