CDI类BeanManager
有几种采用类型为Annotation
或的参数的方法Annotation...
。例如BeanManager.getBeans(...)
。
我想知道如何将我的注释作为参数传递给那些方法。
我已经尝试过了BeanManager.getBeans(MyBean.class, MyAnnotation.class)
,但是那样行不通。我见过Class.isAnnotation()
,但是没有什么像Class.asAnnotation()
将其作为Annotation
类型进行检索的。
既没有用BeanManager.getBeans(MyBean.class, @MyAnnotation)
,也没有用BeanManager.getBeans(MyBean.class, (Annotation) MyAnnotation.class)
。
如何获取注释类的类型Annotation
?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句