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.SysDepartment;

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

	@Override
	public void validate(Object arg0, Errors errors) {
		ValidationUtils.rejectIfEmpty(errors, "depname", null, "部门名称不能为空");
	}
}
