tedberg,
I'd be happy to help out. Although I really haven't needed to write much code at all, that was the beauty of using the hibernate validator. Here is all I needed to do in my Spring validator:
Code:
public boolean supports(Class aClass)
{
return DomainObject.class.isAssignableFrom(aClass);
}
public void validate(Object object, Errors errors)
{
DomainObject domainObject = (DomainObject) object;
List<InvalidValue> invalids = domainObject.validate();
for (int i = 0; i < invalids.size(); i++)
{
InvalidValue invalidValue = invalids.get(i);
errors.rejectValue(invalidValue.getPropertyName(), null, invalidValue.getMessage());
}
}
I just need to change the invalidValue.getPropertyName() to use the new getPropertyPath method.