我可以以某种方式创建1个注释来替换另一个默认值吗?

时间:2014-05-29 05:26:10

标签: java annotations

我担心头衔不好,但无法更好地表达。所以,我有这个代码:

@javax.interceptor.Interceptors({EjbSecurityServerInterceptor.class,PermissionInterceptor.class})

有没有办法创建像@SecuredAsHell这样的注释,它将等同于上述注释?我猜想,它就像宏一样。

由于

1 个答案:

答案 0 :(得分:0)

没有。抱歉,事实是无论用于查找javax.interceptor.Interceptors类型的注释的反射都只能找到该类型的注释。没有办法表明另一个注释在某种程度上是等价的。