Home / Function/ isCandidate() — spring-boot Function Reference

isCandidate() — spring-boot Function Reference

Architecture documentation for the isCandidate() function in OnBeanCondition.java from the spring-boot codebase.

Function java GradlePlugin RunTasks calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  edcae5e6_d879_8173_be3e_a74b4c779e1c["isCandidate()"]
  e8d44fa6_45ad_6d14_6468_53ed18c907e0["getMatchingBeans()"]
  e8d44fa6_45ad_6d14_6468_53ed18c907e0 -->|calls| edcae5e6_d879_8173_be3e_a74b4c779e1c
  92fdfb00_0554_752e_98dc_dc790fb55e8e["isDefaultCandidate()"]
  edcae5e6_d879_8173_be3e_a74b4c779e1c -->|calls| 92fdfb00_0554_752e_98dc_dc790fb55e8e
  45d92a7f_3ef5_eda1_c3ba_184757daec7e["getBeanDefinition()"]
  edcae5e6_d879_8173_be3e_a74b4c779e1c -->|calls| 45d92a7f_3ef5_eda1_c3ba_184757daec7e
  style edcae5e6_d879_8173_be3e_a74b4c779e1c 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 280–300

	private boolean isCandidate(ConfigurableListableBeanFactory beanFactory, String name,
			@Nullable BeanDefinition definition, Set<String> ignoredBeans) {
		if (ignoredBeans.contains(name)) {
			return false;
		}
		if (definition == null || (definition.isAutowireCandidate() && isDefaultCandidate(definition))) {
			return true;
		}
		if (ScopedProxyUtils.isScopedTarget(name)) {
			try {
				BeanDefinition originalDefinition = beanFactory
					.getBeanDefinition(ScopedProxyUtils.getOriginalBeanName(name));
				if (originalDefinition.isAutowireCandidate() && isDefaultCandidate(originalDefinition)) {
					return true;
				}
			}
			catch (NoSuchBeanDefinitionException ex) {
			}
		}
		return false;
	}

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

What does isCandidate() do?
isCandidate() is a function in the spring-boot codebase.
What does isCandidate() call?
isCandidate() calls 2 function(s): getBeanDefinition, isDefaultCandidate.
What calls isCandidate()?
isCandidate() is called by 1 function(s): getMatchingBeans.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free