org.apache.wicket.bean.validation.IViolationTranslator Maven / Gradle / Ivy
package org.apache.wicket.bean.validation;
import javax.validation.ConstraintViolation;
import org.apache.wicket.validation.ValidationError;
/**
* Converts {@link ConstraintViolation}s into Wicket's {@link ValidationError}s
*
* @author igor
* @see BeanValidationConfiguration#setViolationTranslator(org.apache.wicket.bean.validation.IViolationTranslator)
*/
@FunctionalInterface
public interface IViolationTranslator
{
/**
* Converts a {@link ConstraintViolation} into a {@link ValidationError}
*
* @param
* @param violation
* constraint violation from bean validation
* @return validation validation error to be reported on the component
*/
ValidationError convert(ConstraintViolation violation);
}