标签: bean-manager

如何将Annotation作为参数传递?

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

java parameters annotations cdi bean-manager

8
推荐指数
1
解决办法
3214
查看次数

标签 统计

annotations ×1

bean-manager ×1

cdi ×1

java ×1

parameters ×1