com.github.ldeitos.validation.ValidationClosure Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of extendedValidation-core Show documentation
Show all versions of extendedValidation-core Show documentation
Extension for BeanValidation API Core. Content interfaces, qualifiers and constraints definitions.
This version is Java 17 and JakartaEE 10 compatible.
The newest version!
package com.github.ldeitos.validation;
import java.util.Set;
import com.github.ldeitos.exception.ViolationException;
import com.github.ldeitos.qualifier.Closure;
/**
* Closure to be executed when occurs violations on objects validation during
* validation interception.
* Custom implementations must be qualified with {@link Closure} qualifier.
* A default implementation also can be defined in configuration file or, if
* not, a simple built-in component implementation will be used, this will just
* throw a {@link ViolationException}.
*
* @author Leandro Deitos
*
* @see Closure
*
* @since 0.9.2
*/
public interface ValidationClosure {
/**
* Method to be executed when occurs violations in validation process.
*
* @param messages
* Violation messages obtained in parameters validation.
* @throws Exception
* Allow closure implementation throw a exception.
*/
void proceed(Set messages) throws Exception;
}