本文整理汇总了Java中javax.enterprise.inject.spi.BeanManager.isQualifier方法的典型用法代码示例。如果您正苦于以下问题:Java BeanManager.isQualifier方法的具体用法?Java BeanManager.isQualifier怎么用?Java BeanManager.isQualifier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.enterprise.inject.spi.BeanManager
的用法示例。
在下文中一共展示了BeanManager.isQualifier方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolveQualifiers
import javax.enterprise.inject.spi.BeanManager; //导入方法依赖的package包/类
private List<Annotation> resolveQualifiers(ParameterContext pc, BeanManager bm) {
List<Annotation> qualifiers = new ArrayList<>();
if (pc.getParameter().getAnnotations().length == 0) {
return Collections.emptyList();
} else {
for (Annotation annotation : pc.getParameter().getAnnotations()) {
// use BeanManager.isQualifier to be able to detect custom qualifiers which don't need to have @Qualifier
if (bm.isQualifier(annotation.annotationType())) {
qualifiers.add(annotation);
}
}
}
return qualifiers;
}
示例2: FrameworkMethodInjectionPoint
import javax.enterprise.inject.spi.BeanManager; //导入方法依赖的package包/类
FrameworkMethodInjectionPoint(Method method, int position, BeanManager manager) {
this.method = method;
this.annotated = new FrameworkAnnotatedParameter(method, position, manager);
this.type = method.getGenericParameterTypes()[position];
this.qualifiers = new HashSet<>();
for (Annotation annotation : method.getParameterAnnotations()[position]) {
if (manager.isQualifier(annotation.annotationType())) {
qualifiers.add(annotation);
}
}
}