Interface BeanValidationContext


public interface BeanValidationContext
Context object to allow configuring validation behaviour.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The default validation context.
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NonNull BeanValidationContext
    fromGroups(Class<?>... groups)
    Create a validation context from the given groups.
    default List<Class<?>>
    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

  • Method Details

    • groups

      default List<Class<?>> groups()
      The validation groups.
      Returns:
      The groups
    • fromGroups

      @NonNull static @NonNull BeanValidationContext fromGroups(Class<?>... groups)
      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 validated
      property - The property being validated.
      Returns:
      True if it should be validated.