Package io.micronaut.inject.validation
Interface BeanDefinitionValidator
-
public interface BeanDefinitionValidatorInterface to integrate bean validation into the construction of beans within theBeanContext.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description static BeanDefinitionValidatorDEFAULTA default no-op validator.
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default <T> voidvalidateBean(BeanResolutionContext resolutionContext, BeanDefinition<T> definition, T bean)Validates the given bean after it has been constructor.default <T> voidvalidateBeanArgument(BeanResolutionContext resolutionContext, InjectionPoint injectionPoint, io.micronaut.core.type.Argument<T> argument, int index, T value)Validates the given bean after it has been constructor.
-
-
-
Field Detail
-
DEFAULT
static final BeanDefinitionValidator DEFAULT
A default no-op validator.
-
-
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 BeanInstantiationExceptionValidates the given bean after it has been constructor.- Type Parameters:
T- The bean type- Parameters:
resolutionContext- The resolution contextinjectionPoint- The injection pointargument- The argumentindex- The argument indexvalue- 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 BeanInstantiationExceptionValidates the given bean after it has been constructor.- Type Parameters:
T- The bean type- Parameters:
resolutionContext- The resolution contextdefinition- The definitionbean- The bean to validate- Throws:
BeanInstantiationException- if the bean is invalid
-
-