OnBeanCondition.java 文件源码

java
阅读 54 收藏 0 点赞 0 评论 0

项目:spring-boot-concourse 作者:
BeanSearchSpec(ConditionContext context, AnnotatedTypeMetadata metadata,
        Class<?> annotationType) {
    this.annotationType = annotationType;
    MultiValueMap<String, Object> attributes = metadata
            .getAllAnnotationAttributes(annotationType.getName(), true);
    collect(attributes, "name", this.names);
    collect(attributes, "value", this.types);
    collect(attributes, "type", this.types);
    collect(attributes, "annotation", this.annotations);
    collect(attributes, "ignored", this.ignoredTypes);
    collect(attributes, "ignoredType", this.ignoredTypes);
    this.strategy = (SearchStrategy) metadata
            .getAnnotationAttributes(annotationType.getName()).get("search");
    BeanTypeDeductionException deductionException = null;
    try {
        if (this.types.isEmpty() && this.names.isEmpty()) {
            addDeducedBeanType(context, metadata, this.types);
        }
    }
    catch (BeanTypeDeductionException ex) {
        deductionException = ex;
    }
    validate(deductionException);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号