package com.vst.webapp.validators;
import com.vst.model.LevelPlan;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;
/**
* Created by IntelliJ IDEA.
* User: Lilia
* Date: 09.12.2009
* Time: 13:46:02
* To change this template use File | Settings | File Templates.
*/
public class LevelPlanValidator implements Validator {
public boolean supports(Class aClass) {
return LevelPlan.class.isAssignableFrom(aClass);
}
public void validate(Object o, Errors errors) {
LevelPlan levelPlan=(LevelPlan)o;
if (levelPlan.getComment().trim().equals("")){
errors.rejectValue("comment","levelPlan.comment");
}
}
}