Interface Condition
- All Known Implementing Classes:
OnPropertyCondition
public interface Condition
Decides whether a bean carrying a given conditioning annotation is registered. Implementations are discovered via
ServiceLoader and keyed by annotationType().
This is the framework's first runtime SPI that reads annotation attribute values: matches(ConditionContext, AnnotationValue) receives the
AnnotationValue captured at compile time, so a condition can branch on the annotation's members.
-
Method Summary
Modifier and TypeMethodDescriptionClass<? extends Annotation> Returns the conditioning annotation this condition handles.booleanmatches(ConditionContext context, AnnotationValue annotation) Returns whether the bean should be registered.
-
Method Details
-
annotationType
Class<? extends Annotation> annotationType()Returns the conditioning annotation this condition handles.- Returns:
- the conditioning annotation this condition handles
-
matches
Returns whether the bean should be registered.- Parameters:
context- the evaluation environmentannotation- the conditioning annotation's captured value, including its members- Returns:
- whether the bean should be registered
-