Package io.micronaut.inject.validation
Interface BeanDefinitionValidator
public interface BeanDefinitionValidator
Interface to integrate bean validation into the construction of beans within the
BeanContext
.- Since:
- 1.0
- Author:
- graemerocher
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault <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 Argument<T> argument, int index, T value) Validates the given bean after it has been constructor.
-
Field Details
-
DEFAULT
A default no-op validator.
-
-
Method Details
-
validateBeanArgument
default <T> void validateBeanArgument(@NonNull @NonNull BeanResolutionContext resolutionContext, @NonNull @NonNull InjectionPoint injectionPoint, @NonNull @NonNull 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 contextinjectionPoint
- The injection pointargument
- The argumentindex
- The argument indexvalue
- 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 contextdefinition
- The definitionbean
- The bean to validate- Throws:
BeanInstantiationException
- if the bean is invalid
-