是否有可能我将自定义注释放在类上,然后强制开发人员将注释放在方法上?
假设我有三个自定义注释
- @Loggable
- @MySQLLoggable
- @CassandraLoggable
当我在 class 上放置@Loggble注释时,它强制开发人员通过@MySQLLoggable或@CassandraLoggable注释其所有方法。
让我知道!
已编辑
@Loggable // Suppose I put this annotation on class
public class Service {
@MySQLLoggable //eclipse forceful the developer
//to put @MySQLLoggable or @CassandraLoggable on sayHello()
public String sayHello() {
return null;
}
}