2

如果字段是非私有的并且它没有注释之一,有什么方法可以使用 Checkstyle 发出警告?

IE:

public class Foo {
   private String mBoo; // this is OK
   public String mBad; // it should be warning
   [@Bean][1]
   String mBean; // it is OK
   @Bean
   public String mBean; // it should be warning (because it is public)
}

@编辑

有多个注解,如@Bean注解

4

0 回答 0