Interface BeanDefinitionValidator


public interface BeanDefinitionValidator
Interface to integrate bean validation into the construction of beans within the BeanContext.
Since:
1.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    A default no-op validator.
  • Method Summary

    Modifier and Type
    Method
    Description
    default <T> void
    validateBean(@NonNull BeanResolutionContext resolutionContext, @NonNull BeanDefinition<T> definition, T bean)
    Validates the given bean after it has been constructor.
    default <T> void
    validateBeanArgument(@NonNull BeanResolutionContext resolutionContext, @NonNull InjectionPoint injectionPoint, @NonNull io.micronaut.core.type.Argument<T> argument, int index, T value)
    Validates the given bean after it has been constructor.
  • Field Details

  • Method Details

    • validateBeanArgument

      default <T> void validateBeanArgument(@NonNull @NonNull BeanResolutionContext resolutionContext, @NonNull @NonNull InjectionPoint injectionPoint, @NonNull @NonNull io.micronaut.core.type.Argument<T> argument, int index, @Nullable T value) throws BeanInstantiationException
      Validates the given bean after it has been constructor.
      Type Parameters:
      T - The bean type
      Parameters:
      resolutionContext - The resolution context
      injectionPoint - The injection point
      argument - The argument
      index - The argument index
      value - The value
      Throws:
      BeanInstantiationException - if the bean is invalid
    • validateBean

      default <T> void validateBean(@NonNull @NonNull BeanResolutionContext resolutionContext, @NonNull @NonNull BeanDefinition<T> definition, @NonNull T bean) throws BeanInstantiationException
      Validates the given bean after it has been constructor.
      Type Parameters:
      T - The bean type
      Parameters:
      resolutionContext - The resolution context
      definition - The definition
      bean - The bean to validate
      Throws:
      BeanInstantiationException - if the bean is invalid