Interface ExecutableMethodValidator
-
- All Superinterfaces:
javax.validation.executable.ExecutableValidator
- All Known Implementing Classes:
DefaultAnnotatedElementValidator
,DefaultValidator
public interface ExecutableMethodValidator extends javax.validation.executable.ExecutableValidator
Extended version ofExecutableValidator
that operates onExecutableMethod
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 givenExecutableMethod
.<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 givenExecutableMethod
.<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 aExecutableMethod
.<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 typearguments
- The arguments- Returns:
- The instance
- Throws:
javax.validation.ConstraintViolationException
- If a valid instance couldn't be constructedjava.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 givenExecutableMethod
.- Type Parameters:
T
- The object type- Parameters:
object
- The objectmethod
- The methodparameterValues
- The valuesgroups
- 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 givenExecutableMethod
.- Type Parameters:
T
- The object type- Parameters:
object
- The objectmethod
- The methodargumentValues
- The valuesgroups
- 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 aExecutableMethod
.- Type Parameters:
T
- The object type- Parameters:
object
- The objectexecutableMethod
- The methodreturnValue
- The return valuegroups
- 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 introspectionparameterValues
- The parameter valuesgroups
- 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 typeconstructorArguments
- The constructor argumentsparameterValues
- The parameter valuesgroups
- 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 interfacejavax.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 interfacejavax.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 interfacejavax.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 interfacejavax.validation.executable.ExecutableValidator
-
-