Spec() — spring-boot Function Reference
Architecture documentation for the Spec() function in OnBeanCondition.java from the spring-boot codebase.
Entity Profile
Dependency Diagram
graph TD 14ef4e99_fc3b_79df_b329_a8d884951727["Spec()"] b215a045_003d_ca5f_f7f1_607aa7b55546["extract()"] 14ef4e99_fc3b_79df_b329_a8d884951727 -->|calls| b215a045_003d_ca5f_f7f1_607aa7b55546 1bfed78f_d5e7_33a6_761f_a21d8ee30d78["resolveWhenPossible()"] 14ef4e99_fc3b_79df_b329_a8d884951727 -->|calls| 1bfed78f_d5e7_33a6_761f_a21d8ee30d78 946b2615_9e88_3282_86f9_2063543bf4b9["deducedBeanType()"] 14ef4e99_fc3b_79df_b329_a8d884951727 -->|calls| 946b2615_9e88_3282_86f9_2063543bf4b9 5f7f6b86_e4e1_3c58_a600_2409c3234a60["extractTypes()"] 14ef4e99_fc3b_79df_b329_a8d884951727 -->|calls| 5f7f6b86_e4e1_3c58_a600_2409c3234a60 d54dda79_a803_1852_ac8f_9f548ff1ba14["validate()"] 14ef4e99_fc3b_79df_b329_a8d884951727 -->|calls| d54dda79_a803_1852_ac8f_9f548ff1ba14 style 14ef4e99_fc3b_79df_b329_a8d884951727 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.java lines 579–604
Spec(ConditionContext context, AnnotatedTypeMetadata metadata, MergedAnnotations annotations,
Class<A> annotationType) {
MultiValueMap<String, @Nullable Object> attributes = annotations.stream(annotationType)
.filter(MergedAnnotationPredicates.unique(MergedAnnotation::getMetaTypes))
.collect(MergedAnnotationCollectors.toMultiValueMap(Adapt.CLASS_TO_STRING));
MergedAnnotation<A> annotation = annotations.get(annotationType);
this.context = context;
this.annotationType = annotationType;
this.names = extract(attributes, "name");
this.annotations = extract(attributes, "annotation");
this.ignoredTypes = resolveWhenPossible(extract(attributes, "ignored", "ignoredType"));
this.parameterizedContainers = resolveWhenPossible(extract(attributes, "parameterizedContainer"));
this.strategy = annotation.getValue("search", SearchStrategy.class).orElse(null);
Set<BeanType> types = resolveWhenPossible(extractTypes(attributes));
BeanTypeDeductionException deductionException = null;
if (types.isEmpty() && this.names.isEmpty() && this.annotations.isEmpty()) {
try {
types = deducedBeanType(context, metadata);
}
catch (BeanTypeDeductionException ex) {
deductionException = ex;
}
}
this.types = types;
validate(deductionException);
}
Domain
Subdomains
Calls
- deducedBeanType()
- extract()
- extractTypes()
- resolveWhenPossible()
- validate()
Source
Frequently Asked Questions
What does Spec() do?
Spec() is a function in the spring-boot codebase.
What does Spec() call?
Spec() calls 5 function(s): deducedBeanType, extract, extractTypes, resolveWhenPossible, validate.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free