Interface ConditionContext<T extends AnnotationMetadataProvider>

Type Parameters:
T - The type
All Superinterfaces:
BeanLocator, PropertyResolver, ValueResolver<String>

public interface ConditionContext<T extends AnnotationMetadataProvider> extends BeanLocator, PropertyResolver
The ConditionContext passed to a Condition.
Since:
1.0
Author:
Graeme Rocher
  • Method Details

    • getComponent

      T getComponent()
      The component for which the condition is being evaluated.
      Returns:
      Either a BeanDefinition or a BeanConfiguration
    • getBeanContext

      BeanContext getBeanContext()
      Returns:
      The bean context
    • getBeanResolutionContext

      @Nullable BeanResolutionContext getBeanResolutionContext()
      Returns:
      The resolution context
    • findBeanDefinitions

      <K> @NonNull Collection<BeanDefinition<K>> findBeanDefinitions(@NonNull Class<K> beanType)
      Finds and returns all bean definitions of the specified type.
      Type Parameters:
      K - The type of the beans.
      Parameters:
      beanType - The class type of the beans to find.
      Returns:
      A collection of BeanDefinition instances corresponding to the specified type.
      Since:
      5.0
    • fail

      ConditionContext<T> fail(@NonNull Failure failure)
      Fail the condition with the given message.
      Parameters:
      failure - The failure
      Returns:
      The ConditionContext
    • fail

      default ConditionContext<T> fail(@NonNull String failure)
      Fail the condition with the given message.
      Parameters:
      failure - The failure
      Returns:
      The ConditionContext
    • getFailures

      default List<Failure> getFailures()
      Returns:
      A list of failures for the condition
    • isFailing

      default boolean isFailing()
      Returns:
      Whether there are any failures