package org.yacos.web.PCmember.validation;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;
import org.yacos.web.PCmember.form.FormArticleMessage;

public class ForumArticleValidator implements Validator {
	
	@SuppressWarnings("unchecked")
	public boolean supports(Class commandClass) {
		return commandClass.isAssignableFrom(FormArticleMessage.class);
	}

	public void validate(Object commandObject, Errors errors) {		
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "message", "forum.validation");
	}
}
