▣ 동작원리
▣ @Conditional Annotation
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface Conditional {
/**
* All `Condition`s that must `Condition#matches` match in order for the component to be registered.
*/
Class<? extends Condition>[] value();
}
▣ Condition Interface
public interface Condition {
/**
* Determine if the condition matches.
*/
boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata);
}