In the Apache Wicket framework, validation is performed before any of the properties are set on the object. When a validation error occurs, the properties are not set at all. With the current API available, validation in Wicket would be limited to using the Validator.validateValue, which can only validate constraints on properties. Is it perhaps possible to add a method to the Validator interface that accepts a set of 'properties-to-be-set'? Something like:
Code:
<T> Set<ConstraintViolation<T>> validate(T object, Map<String, Object> properties, Class<?>... groups);
or
<T> Set<ConstraintViolation<T>> validate(T object, Set<PropertyValue> properties, Class<?>... groups);
Another option would be to provide the posibillity for using a custom PropertyResolver, which would allow property values to be taken from a different source (not the object being validated), such as a map.
Best regards,
Emond Papegaaij