package inc.monsters.mias.validators;

import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;

public class NoBartValidator implements Validator {

	public NoBartValidator() {
	}

	public void validate(FacesContext ctx, UIComponent comp, Object value)
			throws ValidatorException {
		if("Bart".equals(value)) {
			throw new ValidatorException(new FacesMessage("First name Bart is not allowed."));
		}
	}
}