本文整理匯總了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);
}
}
}