-
public interface ExecutableValidator
Validates parameters and return values of methods and constructors. Implementations of this interface must be thread-safe.- Since:
- 1.1
- Author:
- Gunnar Morling
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description <T> Set<ConstraintViolation<T>>
validateConstructorParameters(Constructor<? extends T> constructor, Object[] parameterValues, Class<?>... groups)
Validates all constraints placed on the parameters of the given constructor.<T> Set<ConstraintViolation<T>>
validateConstructorReturnValue(Constructor<? extends T> constructor, T createdObject, Class<?>... groups)
Validates all return value constraints of the given constructor.<T> Set<ConstraintViolation<T>>
validateParameters(T object, Method method, Object[] parameterValues, Class<?>... groups)
Validates all constraints placed on the parameters of the given method.<T> Set<ConstraintViolation<T>>
validateReturnValue(T object, Method method, Object returnValue, Class<?>... groups)
Validates all return value constraints of the given method.
-
-
-
Method Detail
-
validateParameters
<T> Set<ConstraintViolation<T>> validateParameters(T object, Method method, Object[] parameterValues, Class<?>... groups)
Validates all constraints placed on the parameters of the given method.- Type Parameters:
T
- the type hosting the method to validate- Parameters:
object
- the object on which the method to validate is invokedmethod
- the method for which the parameter constraints is validatedparameterValues
- the values provided by the caller for the given method's parametersgroups
- the group or list of groups targeted for validation (defaults toDefault
)- Returns:
- a set with the constraint violations caused by this validation;
will be empty if no error occurs, but never
null
- Throws:
IllegalArgumentException
- ifnull
is passed for any of the parameters or if parameters don't match with each otherValidationException
- if a non recoverable error happens during the validation process
-
validateReturnValue
<T> Set<ConstraintViolation<T>> validateReturnValue(T object, Method method, Object returnValue, Class<?>... groups)
Validates all return value constraints of the given method.- Type Parameters:
T
- the type hosting the method to validate- Parameters:
object
- the object on which the method to validate is invokedmethod
- the method for which the return value constraints is validatedreturnValue
- the value returned by the given methodgroups
- the group or list of groups targeted for validation (defaults toDefault
)- Returns:
- a set with the constraint violations caused by this validation;
will be empty if no error occurs, but never
null
- Throws:
IllegalArgumentException
- ifnull
is passed for any of the object, method or groups parameters or if parameters don't match with each otherValidationException
- if a non recoverable error happens during the validation process
-
validateConstructorParameters
<T> Set<ConstraintViolation<T>> validateConstructorParameters(Constructor<? extends T> constructor, Object[] parameterValues, Class<?>... groups)
Validates all constraints placed on the parameters of the given constructor.- Type Parameters:
T
- the type hosting the constructor to validate- Parameters:
constructor
- the constructor for which the parameter constraints is validatedparameterValues
- the values provided by the caller for the given constructor's parametersgroups
- the group or list of groups targeted for validation (defaults toDefault
)- Returns:
- a set with the constraint violations caused by this validation;
Will be empty if no error occurs, but never
null
- Throws:
IllegalArgumentException
- ifnull
is passed for any of the parameters or if parameters don't match with each otherValidationException
- if a non recoverable error happens during the validation process
-
validateConstructorReturnValue
<T> Set<ConstraintViolation<T>> validateConstructorReturnValue(Constructor<? extends T> constructor, T createdObject, Class<?>... groups)
Validates all return value constraints of the given constructor.- Type Parameters:
T
- the type hosting the constructor to validate- Parameters:
constructor
- the constructor for which the return value constraints is validatedcreatedObject
- the object instantiated by the given methodgroups
- the group or list of groups targeted for validation (defaults toDefault
)- Returns:
- a set with the constraint violations caused by this validation;
will be empty, if no error occurs, but never
null
- Throws:
IllegalArgumentException
- ifnull
is passed for any of the parameters or if parameters don't match with each otherValidationException
- if a non recoverable error happens during the validation process
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
21/08/2025 18:30:38 Cette version de la page est en cache (à la date du 21/08/2025 18:30:38) afin d'accélérer le traitement.Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.
Document créé le 11/06/2005, dernière modification le 18/08/2025
Source du document imprimé : https://www.gaudry.be/java-api-javaee-rf-javax/validation/executable/executablevalidator.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.