/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package validators;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
import com.corejsf.util.Messages;

/**
 *
 * @author Glavni Administrator
 */
public class ZipCodeValidator implements Validator {

    public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException {
      if(!"11000".equals(value.toString())){
      throw new ValidatorException(Messages.getMessage("com.corejsf.messages", "badZip"));
      }
          
        
    }

}
