package com.ssm.model.validator;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

import com.ssm.model.system.SysMenu;

public class SysMenuValidator implements Validator{
	@Override
	public boolean supports(Class<?> arg0) {
		return SysMenu.class.equals(arg0);
	}

	@Override
	public void validate(Object arg0, Errors errors) {
		ValidationUtils.rejectIfEmpty(errors, "menucnname", null, "菜单中文名不能为空");
		ValidationUtils.rejectIfEmpty(errors, "menuenname", null, "菜单英文名不能为空");
		
	}
}
