Interface BeanDefinitionValidator


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

      • validateBeanArgument

        default <T> void validateBeanArgument​(@NonNull
                                              BeanResolutionContext resolutionContext,
                                              @NonNull
                                              InjectionPoint injectionPoint,
                                              @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
                                      BeanResolutionContext resolutionContext,
                                      @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