如何在Java注解中放一个list

示例如下:

public @interface CustomAnnot {
    String[] author() default "me";
    String description() default "";
}

用这个注解的时候这样用:

@CustomAnnot(author={"author1","author2"}, description="test")

参考资料:

1. https://stackoverflow.com/questions/20632940/how-to-set-string-array-in-java-annotation

2. https://stackoverflow.com/questions/2065937/how-to-supply-value-to-an-annotation-from-a-constant-java

你可能感兴趣的:(如何在Java注解中放一个list)