package de.ivu.elect;

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

import de.ivu.elect.jee.faces.FacesMessageUtil;

public class EmlHashCodeBestaetigenValidator implements Validator {
  @Override
  public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException {

    if (value==null || !Boolean.TRUE.toString().equalsIgnoreCase(value.toString())) {
      throw new ValidatorException(
          FacesMessageUtil.createErrorMessage(context, "eml.hash.code.bestaetigen", "eml.hash.code.bestaetigen"));

    }
  }
}
