public class DefaultViolationTranslator extends Object implements IViolationTranslator
IViolationTranslator
. The validation error is created with
the constraint violation's default error message. Further, the violation is checked for a message
key and if is found it is also added as a message key to the validation error. The keys are only
used if they are in the bean validation's default format of '{key}'.Constructor and Description |
---|
DefaultViolationTranslator() |
Modifier and Type | Method and Description |
---|---|
<T> ValidationError |
convert(javax.validation.ConstraintViolation<T> violation)
Converts a
ConstraintViolation into a ValidationError |
public <T> ValidationError convert(javax.validation.ConstraintViolation<T> violation)
IViolationTranslator
ConstraintViolation
into a ValidationError
convert
in interface IViolationTranslator
violation
- constraint violation from bean validationCopyright © 2006–2022 Apache Software Foundation. All rights reserved.