Conditions are checked immediately before the bean definition is due to be registered and are free to veto registration based on any criteria that can be determined at that point.
Conditions must follow the same restrictions as a BeanFactoryPostProcessor
and take care to never interact with bean instances. For more fine-grained control
over conditions that interact with @Configuration beans, consider implementing
the ConfigurationCondition interface.
Multiple conditions on a given class or on a given method will be ordered
according to the semantics of Spring's org.
interface and @Order annotation.
See org.
for details.
ConfigurationCondition, Conditional, ConditionContext
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the condition matches and the component can be registered,
or false to veto the annotated component's registrationthe condition context context, AnnotatedTypeMetadata metadata)Determine if the condition matches. |
| matches | back to summary |
|---|---|
| public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) Determine if the condition matches.
| |