Interface ExecutableMethodValidator

All Superinterfaces:
jakarta.validation.executable.ExecutableValidator
All Known Implementing Classes:
DefaultAnnotatedElementValidator, DefaultValidator

public interface ExecutableMethodValidator extends jakarta.validation.executable.ExecutableValidator
Extended version of ExecutableValidator that operates on ExecutableMethod instances.
Since:
1.2
Author:
graemerocher
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    createValid(@NonNull Class<T> type, Object... arguments)
    Create a new valid instance.
    <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>>
    validateConstructorParameters(@NonNull io.micronaut.core.beans.BeanIntrospection<? extends T> introspection, @NonNull Object[] parameterValues, @Nullable Class<?>... groups)
    Validates parameters for the given introspection and values.
    <T> Set<jakarta.validation.ConstraintViolation<T>>
    validateConstructorParameters(@NonNull Class<? extends T> beanType, @NonNull io.micronaut.core.type.Argument<?>[] constructorArguments, @NonNull Object[] parameterValues, @Nullable BeanValidationContext validationContext)
    Validates arguments for the given bean type and constructor arguments.
    <T> Set<jakarta.validation.ConstraintViolation<T>>
    validateConstructorParameters(@NonNull Class<? extends T> beanType, @NonNull io.micronaut.core.type.Argument<?>[] constructorArguments, @NonNull Object[] parameterValues, @Nullable Class<?>[] groups)
    Validates arguments for the given bean type and constructor arguments.
    <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>>
    validateConstructorParameters(@NonNull Constructor<? extends T> constructor, @NonNull Object[] parameterValues, @Nullable Class<?>... groups)
     
    <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>>
    validateConstructorReturnValue(@NonNull Constructor<? extends T> constructor, T createdObject, @Nullable Class<?>... groups)
     
    <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>>
    validateParameters(T object, @NonNull io.micronaut.inject.ExecutableMethod method, @NonNull Object[] parameterValues, @Nullable BeanValidationContext context)
    Validate the parameter values of the given ExecutableMethod.
    <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>>
    validateParameters(T object, @NonNull io.micronaut.inject.ExecutableMethod method, @NonNull Object[] parameterValues, @Nullable Class<?>... groups)
    Validate the parameter values of the given ExecutableMethod.
    <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>>
    validateParameters(T object, @NonNull io.micronaut.inject.ExecutableMethod method, @NonNull Collection<io.micronaut.core.type.MutableArgumentValue<?>> argumentValues, @Nullable Class<?>... groups)
    Validate the parameter values of the given ExecutableMethod.
    <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>>
    validateParameters(T object, @NonNull Method method, @NonNull Object[] parameterValues, @Nullable Class<?>... groups)
     
    <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>>
    validateReturnValue(T object, @NonNull io.micronaut.inject.ExecutableMethod<?,Object> executableMethod, @Nullable Object returnValue, @Nullable BeanValidationContext validationContext)
    Validates the return value of a ExecutableMethod.
    <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>>
    validateReturnValue(T object, @NonNull io.micronaut.inject.ExecutableMethod<?,Object> executableMethod, @Nullable Object returnValue, @Nullable Class<?>... groups)
    Validates the return value of a ExecutableMethod.
    <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>>
    validateReturnValue(T object, @NonNull Method method, @Nullable Object returnValue, @Nullable Class<?>... groups)
     
  • Method Details

    • createValid

      @NonNull <T> T createValid(@NonNull @NonNull Class<T> type, Object... arguments) throws jakarta.validation.ConstraintViolationException
      Create a new valid instance.
      Type Parameters:
      T - the generic type
      Parameters:
      type - The type
      arguments - The arguments
      Returns:
      The instance
      Throws:
      jakarta.validation.ConstraintViolationException - If a valid instance couldn't be constructed
      IllegalArgumentException - If an argument is invalid
    • validateParameters

      @NonNull <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>> validateParameters(@NonNull T object, @NonNull @NonNull io.micronaut.inject.ExecutableMethod method, @NonNull @NonNull Object[] parameterValues, @Nullable @Nullable Class<?>... groups)
      Validate the parameter values of the given ExecutableMethod.
      Type Parameters:
      T - The object type
      Parameters:
      object - The object
      method - The method
      parameterValues - The values
      groups - The groups
      Returns:
      The constraint violations.
    • validateParameters

      @NonNull <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>> validateParameters(@NonNull T object, @NonNull @NonNull io.micronaut.inject.ExecutableMethod method, @NonNull @NonNull Object[] parameterValues, @Nullable @Nullable BeanValidationContext context)
      Validate the parameter values of the given ExecutableMethod.
      Type Parameters:
      T - The object type
      Parameters:
      object - The object
      method - The method
      parameterValues - The values
      context - The context
      Returns:
      The constraint violations.
    • validateParameters

      @NonNull <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>> validateParameters(@NonNull T object, @NonNull @NonNull io.micronaut.inject.ExecutableMethod method, @NonNull @NonNull Collection<io.micronaut.core.type.MutableArgumentValue<?>> argumentValues, @Nullable @Nullable Class<?>... groups)
      Validate the parameter values of the given ExecutableMethod.
      Type Parameters:
      T - The object type
      Parameters:
      object - The object
      method - The method
      argumentValues - The values
      groups - The groups
      Returns:
      The constraint violations.
    • validateReturnValue

      @NonNull <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>> validateReturnValue(@NonNull T object, @NonNull @NonNull io.micronaut.inject.ExecutableMethod<?,Object> executableMethod, @Nullable @Nullable Object returnValue, @Nullable @Nullable Class<?>... groups)
      Validates the return value of a ExecutableMethod.
      Type Parameters:
      T - The object type
      Parameters:
      object - The object
      executableMethod - The method
      returnValue - The return value
      groups - The groups
      Returns:
      A set of contstraint violations
    • validateReturnValue

      @NonNull <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>> validateReturnValue(@NonNull T object, @NonNull @NonNull io.micronaut.inject.ExecutableMethod<?,Object> executableMethod, @Nullable @Nullable Object returnValue, @Nullable @Nullable BeanValidationContext validationContext)
      Validates the return value of a ExecutableMethod.
      Type Parameters:
      T - The object type
      Parameters:
      object - The object
      executableMethod - The method
      returnValue - The return value
      validationContext - The validation context
      Returns:
      A set of contstraint violations
    • validateConstructorParameters

      @NonNull <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>> validateConstructorParameters(@NonNull @NonNull io.micronaut.core.beans.BeanIntrospection<? extends T> introspection, @NonNull @NonNull Object[] parameterValues, @Nullable @Nullable Class<?>... groups)
      Validates parameters for the given introspection and values.
      Type Parameters:
      T - The bean type.
      Parameters:
      introspection - The introspection
      parameterValues - The parameter values
      groups - The groups
      Returns:
      The constraint violations
    • validateConstructorParameters

      <T> Set<jakarta.validation.ConstraintViolation<T>> validateConstructorParameters(@NonNull @NonNull Class<? extends T> beanType, @NonNull @NonNull io.micronaut.core.type.Argument<?>[] constructorArguments, @NonNull @NonNull Object[] parameterValues, @Nullable @Nullable Class<?>[] groups)
      Validates arguments for the given bean type and constructor arguments.
      Type Parameters:
      T - The generic type of the bean
      Parameters:
      beanType - The bean type
      constructorArguments - The constructor arguments
      parameterValues - The parameter values
      groups - The validation groups
      Returns:
      A set of constraint violations, if any
    • validateConstructorParameters

      <T> Set<jakarta.validation.ConstraintViolation<T>> validateConstructorParameters(@NonNull @NonNull Class<? extends T> beanType, @NonNull @NonNull io.micronaut.core.type.Argument<?>[] constructorArguments, @NonNull @NonNull Object[] parameterValues, @Nullable @Nullable BeanValidationContext validationContext)
      Validates arguments for the given bean type and constructor arguments.
      Type Parameters:
      T - The generic type of the bean
      Parameters:
      beanType - The bean type
      constructorArguments - The constructor arguments
      parameterValues - The parameter values
      validationContext - The validation context
      Returns:
      A set of constraint violations, if any
    • validateParameters

      @NonNull <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>> validateParameters(@NonNull T object, @NonNull @NonNull Method method, @NonNull @NonNull Object[] parameterValues, @Nullable @Nullable Class<?>... groups)
      Specified by:
      validateParameters in interface jakarta.validation.executable.ExecutableValidator
    • validateReturnValue

      @NonNull <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>> validateReturnValue(@NonNull T object, @NonNull @NonNull Method method, @Nullable @Nullable Object returnValue, @Nullable @Nullable Class<?>... groups)
      Specified by:
      validateReturnValue in interface jakarta.validation.executable.ExecutableValidator
    • validateConstructorParameters

      @NonNull <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>> validateConstructorParameters(@NonNull @NonNull Constructor<? extends T> constructor, @NonNull @NonNull Object[] parameterValues, @Nullable @Nullable Class<?>... groups)
      Specified by:
      validateConstructorParameters in interface jakarta.validation.executable.ExecutableValidator
    • validateConstructorReturnValue

      @NonNull <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>> validateConstructorReturnValue(@NonNull @NonNull Constructor<? extends T> constructor, @NonNull T createdObject, @Nullable @Nullable Class<?>... groups)
      Specified by:
      validateConstructorReturnValue in interface jakarta.validation.executable.ExecutableValidator