Interface ExecutableMethodValidator

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

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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <T> T createValid​(java.lang.Class<T> type, java.lang.Object... arguments)
      Create a new valid instance.
      <T> java.util.Set<javax.validation.ConstraintViolation<T>> validateConstructorParameters​(io.micronaut.core.beans.BeanIntrospection<? extends T> introspection, java.lang.Object[] parameterValues, java.lang.Class<?>... groups)
      Validates parameters for the given introspection and values.
      <T> java.util.Set<javax.validation.ConstraintViolation<T>> validateConstructorParameters​(java.lang.Class<? extends T> beanType, io.micronaut.core.type.Argument<?>[] constructorArguments, java.lang.Object[] parameterValues, java.lang.Class<?>[] groups)
      Validates arguments for the given bean type and constructor arguments.
      <T> java.util.Set<javax.validation.ConstraintViolation<T>> validateConstructorParameters​(java.lang.reflect.Constructor<? extends T> constructor, java.lang.Object[] parameterValues, java.lang.Class<?>... groups)  
      <T> java.util.Set<javax.validation.ConstraintViolation<T>> validateConstructorReturnValue​(java.lang.reflect.Constructor<? extends T> constructor, T createdObject, java.lang.Class<?>... groups)  
      <T> java.util.Set<javax.validation.ConstraintViolation<T>> validateParameters​(T object, io.micronaut.inject.ExecutableMethod method, java.lang.Object[] parameterValues, java.lang.Class<?>... groups)
      Validate the parameter values of the given ExecutableMethod.
      <T> java.util.Set<javax.validation.ConstraintViolation<T>> validateParameters​(T object, io.micronaut.inject.ExecutableMethod method, java.util.Collection<io.micronaut.core.type.MutableArgumentValue<?>> argumentValues, java.lang.Class<?>... groups)
      Validate the parameter values of the given ExecutableMethod.
      <T> java.util.Set<javax.validation.ConstraintViolation<T>> validateParameters​(T object, java.lang.reflect.Method method, java.lang.Object[] parameterValues, java.lang.Class<?>... groups)  
      <T> java.util.Set<javax.validation.ConstraintViolation<T>> validateReturnValue​(T object, io.micronaut.inject.ExecutableMethod<?,​java.lang.Object> executableMethod, java.lang.Object returnValue, java.lang.Class<?>... groups)
      Validates the return value of a ExecutableMethod.
      <T> java.util.Set<javax.validation.ConstraintViolation<T>> validateReturnValue​(T object, java.lang.reflect.Method method, java.lang.Object returnValue, java.lang.Class<?>... groups)  
    • Method Detail

      • createValid

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

        @NonNull
        <T> java.util.Set<javax.validation.ConstraintViolation<T>> validateParameters​(@NonNull
                                                                                      T object,
                                                                                      @NonNull
                                                                                      io.micronaut.inject.ExecutableMethod method,
                                                                                      @NonNull
                                                                                      java.lang.Object[] parameterValues,
                                                                                      @Nullable
                                                                                      java.lang.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> java.util.Set<javax.validation.ConstraintViolation<T>> validateParameters​(@NonNull
                                                                                      T object,
                                                                                      @NonNull
                                                                                      io.micronaut.inject.ExecutableMethod method,
                                                                                      @NonNull
                                                                                      java.util.Collection<io.micronaut.core.type.MutableArgumentValue<?>> argumentValues,
                                                                                      @Nullable
                                                                                      java.lang.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> java.util.Set<javax.validation.ConstraintViolation<T>> validateReturnValue​(@NonNull
                                                                                       T object,
                                                                                       @NonNull
                                                                                       io.micronaut.inject.ExecutableMethod<?,​java.lang.Object> executableMethod,
                                                                                       @Nullable
                                                                                       java.lang.Object returnValue,
                                                                                       @Nullable
                                                                                       java.lang.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
      • validateConstructorParameters

        @NonNull
        <T> java.util.Set<javax.validation.ConstraintViolation<T>> validateConstructorParameters​(@NonNull
                                                                                                 io.micronaut.core.beans.BeanIntrospection<? extends T> introspection,
                                                                                                 @NonNull
                                                                                                 java.lang.Object[] parameterValues,
                                                                                                 @Nullable
                                                                                                 java.lang.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> java.util.Set<javax.validation.ConstraintViolation<T>> validateConstructorParameters​(@NonNull
                                                                                                 java.lang.Class<? extends T> beanType,
                                                                                                 @NonNull
                                                                                                 io.micronaut.core.type.Argument<?>[] constructorArguments,
                                                                                                 @NonNull
                                                                                                 java.lang.Object[] parameterValues,
                                                                                                 @Nullable
                                                                                                 java.lang.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
      • validateParameters

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

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

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

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