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

public class SysDictionaryValidator implements Validator {

	@Override
	public boolean supports(Class<?> clazz) {
		return SysDictionary.class.equals(clazz);
	}

	@Override
	public void validate(Object target, Errors errors) {
		ValidationUtils.rejectIfEmpty(errors, "dictname", null, "常量名称不能为空");
		ValidationUtils.rejectIfEmpty(errors, "dictvalue", null, "常量值不能为空");
	}

}
