Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package javax.validation.executable;
 
 import java.util.Set;
Validates parameters and return values of methods and constructors. Implementations of this interface must be thread-safe.

Author(s):
Gunnar Morling
Since:
1.1
public interface ExecutableValidator {

Validates all constraints placed on the parameters of the given method.

Parameters:
<T> The type hosting the method to validate.
object The object on which the method to validate was invoked.
method The method for which the parameter constraints shall be validated.
parameterValues The values provided by the caller for the given method's parameters.
groups The group or list of groups targeted for validation (defaults to javax.validation.groups.Default).
Returns:
A set with the constraint violations caused by this validation. Will be empty, if no error occurs, but never null.
Throws:
java.lang.IllegalArgumentException if null is passed for any of the parameters
javax.validation.ValidationException if a non recoverable error happens during the validation process
	<T> Set<ConstraintViolation<T>> validateParameters(T objectMethod methodObject[] parameterValuesClass<?>... groups);

Validates all return value constraints of the given method. Throws a ValidationException if the method has no return value.

Parameters:
<T> The type hosting the method to validate.
object The object on which the method to validate was invoked.
method The method for which the return value constraints shall be validated.
returnValue The value returned by the given method.
groups The group or list of groups targeted for validation (defaults to javax.validation.groups.Default).
Returns:
A set with the constraint violations caused by this validation. Will be empty, if no error occurs, but never null.
Throws:
java.lang.IllegalArgumentException if null is passed for any of the object, method or groups parameters
javax.validation.ValidationException if a non recoverable error happens during the validation process
	<T> Set<ConstraintViolation<T>> validateReturnValue(T objectMethod methodObject returnValueClass<?>... groups);

Validates all constraints placed on the parameters of the given constructor.

Parameters:
<T> The type hosting the constructor to validate.
constructor The constructor for which the parameter constraints shall be validated.
parameterValues The values provided by the caller for the given constructor's parameters.
groups The group or list of groups targeted for validation (defaults to javax.validation.groups.Default).
Returns:
A set with the constraint violations caused by this validation. Will be empty, if no error occurs, but never null.
Throws:
java.lang.IllegalArgumentException if null is passed for any of the parameters
javax.validation.ValidationException if a non recoverable error happens during the validation process
	<T> Set<ConstraintViolation<T>> validateConstructorParameters(Constructor<? extends T> constructorObject[] parameterValuesClass<?>... groups);

Validates all return value constraints of the given constructor.

Parameters:
<T> The type hosting the constructor to validate.
constructor The constructor for which the return value constraints shall be validated.
createdObject The object instantiated by the given method.
groups The group or list of groups targeted for validation (defaults to javax.validation.groups.Default).
Returns:
A set with the constraint violations caused by this validation. Will be empty, if no error occurs, but never null.
Throws:
java.lang.IllegalArgumentException if null is passed for any of the parameters
javax.validation.ValidationException if a non recoverable error happens during the validation process
	<T> Set<ConstraintViolation<T>> validateConstructorReturnValue(Constructor<? extends T> constructor, T createdObjectClass<?>... groups);
New to GrepCode? Check out our FAQ X