本文整理了Java中io.micronaut.inject.qualifiers.Qualifiers.byQualifiers
方法的一些代码示例,展示了Qualifiers.byQualifiers
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Qualifiers.byQualifiers
方法的具体详情如下:
包路径:io.micronaut.inject.qualifiers.Qualifiers
类名称:Qualifiers
方法名:byQualifiers
[英]Build a qualifier from other qualifiers.
[中]从其他限定符生成限定符。
代码示例来源:origin: io.micronaut/inject
@Override
@SuppressWarnings("unchecked")
public <T> Optional<BeanDefinition<T>> findProxyTargetBeanDefinition(Class<T> beanType, Qualifier<T> qualifier) {
Qualifier<T> proxyQualifier = qualifier != null ? Qualifiers.byQualifiers(qualifier, PROXY_TARGET_QUALIFIER) : PROXY_TARGET_QUALIFIER;
BeanKey key = new BeanKey(beanType, proxyQualifier);
return (Optional) beanConcreteCandidateCache.get(key, beanKey -> {
BeanRegistration<T> beanRegistration = singletonObjects.get(beanKey);
if (beanRegistration != null) {
if (LOG.isDebugEnabled()) {
LOG.debug("Resolved existing bean [{}] for type [{}] and qualifier [{}]", beanRegistration.bean, beanType, qualifier);
}
return Optional.of(beanRegistration.beanDefinition);
}
return findConcreteCandidateNoCache((Class) beanType, qualifier, true, false, false);
});
}
代码示例来源:origin: io.micronaut/micronaut-inject
@Override
@SuppressWarnings("unchecked")
public <T> Optional<BeanDefinition<T>> findProxyTargetBeanDefinition(Class<T> beanType, Qualifier<T> qualifier) {
Qualifier<T> proxyQualifier = qualifier != null ? Qualifiers.byQualifiers(qualifier, PROXY_TARGET_QUALIFIER) : PROXY_TARGET_QUALIFIER;
BeanKey key = new BeanKey(beanType, proxyQualifier);
return (Optional) beanConcreteCandidateCache.get(key, beanKey -> {
BeanRegistration<T> beanRegistration = singletonObjects.get(beanKey);
if (beanRegistration != null) {
if (LOG.isDebugEnabled()) {
LOG.debug("Resolved existing bean [{}] for type [{}] and qualifier [{}]", beanRegistration.bean, beanType, qualifier);
}
return Optional.of(beanRegistration.beanDefinition);
}
return findConcreteCandidateNoCache((Class) beanType, qualifier, true, false, false);
});
}
代码示例来源:origin: io.micronaut/inject
@SuppressWarnings("unchecked")
@Override
public <T> T getProxyTargetBean(Class<T> beanType, Qualifier<T> qualifier) {
Qualifier<T> proxyQualifier = qualifier != null ? Qualifiers.byQualifiers(qualifier, PROXY_TARGET_QUALIFIER) : PROXY_TARGET_QUALIFIER;
BeanDefinition<T> definition = getProxyTargetBeanDefinition(beanType, qualifier);
return getBeanForDefinition(new DefaultBeanResolutionContext(this, definition), beanType, proxyQualifier, true, definition);
}
代码示例来源:origin: io.micronaut/micronaut-inject
@SuppressWarnings("unchecked")
@Override
public <T> T getProxyTargetBean(Class<T> beanType, Qualifier<T> qualifier) {
Qualifier<T> proxyQualifier = qualifier != null ? Qualifiers.byQualifiers(qualifier, PROXY_TARGET_QUALIFIER) : PROXY_TARGET_QUALIFIER;
BeanDefinition<T> definition = getProxyTargetBeanDefinition(beanType, qualifier);
return getBeanForDefinition(new DefaultBeanResolutionContext(this, definition), beanType, proxyQualifier, true, definition);
}
内容来源于网络,如有侵权,请联系作者删除!