Interface BeanValidationContext
public interface BeanValidationContext
Context object to allow configuring validation behaviour.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final BeanValidationContext
The default validation context. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull BeanValidationContext
fromGroups
(Class<?>... groups) Create a validation context from the given groups.groups()
The validation groups.default <T> boolean
isPropertyValidated
(T object, @NonNull io.micronaut.core.beans.BeanProperty<T, Object> property) Hook to allow exclusion of properties during validation.
-
Field Details
-
DEFAULT
The default validation context.
-
-
Method Details
-
groups
The validation groups.- Returns:
- The groups
-
fromGroups
Create a validation context from the given groups.- Parameters:
groups
- The groups- Returns:
- The context
-
isPropertyValidated
default <T> boolean isPropertyValidated(@NonNull T object, @NonNull @NonNull io.micronaut.core.beans.BeanProperty<T, Object> property) Hook to allow exclusion of properties during validation.- Type Parameters:
T
- The object type- Parameters:
object
- The object being validatedproperty
- The property being validated.- Returns:
- True if it should be validated.
-