Package com.vst.webapp.validators

Source Code of com.vst.webapp.validators.LevelPlanValidator

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");
        }

    }
}
TOP

Related Classes of com.vst.webapp.validators.LevelPlanValidator

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.