package com.mason.server.validator;

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

import com.mason.server.model.View;

public class ViewValidator implements Validator {

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

	@Override
	public void validate(Object obj, Errors errors) {
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "description",
				"description.null");
	}

}
