org.apache.wicket.bean.validation
Class DefaultViolationTranslator

java.lang.Object
  extended by org.apache.wicket.bean.validation.DefaultViolationTranslator
All Implemented Interfaces:
IViolationTranslator

public class DefaultViolationTranslator
extends Object
implements IViolationTranslator

A default implementation of 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}'.

Author:
igor

Constructor Summary
DefaultViolationTranslator()
           
 
Method Summary
<T> ValidationError
convert(javax.validation.ConstraintViolation<T> violation)
          Converts a ConstraintViolation into a ValidationError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultViolationTranslator

public DefaultViolationTranslator()
Method Detail

convert

public <T> ValidationError convert(javax.validation.ConstraintViolation<T> violation)
Description copied from interface: IViolationTranslator
Converts a ConstraintViolation into a ValidationError

Specified by:
convert in interface IViolationTranslator
Parameters:
violation - constraint violation from bean validation
Returns:
validation validation error to be reported on the component


Copyright © 2006–2016 Apache Software Foundation. All rights reserved.