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

package validators;

import com.corejsf.util.Messages;

import javax.faces.context.FacesContext;
import javax.faces.component.UIComponent;
import javax.faces.validator.ValidatorException;
import javax.faces.validator.Validator;
import beans.*;
/**
 *
 * @author CNOC
 */
public class ZipCodeValidator2 implements Validator {
    public void validate(FacesContext fc,
                         UIComponent c,
                         Object zip)
        throws ValidatorException {
        String cityAndState = ZipCodeDataBase.getCityAndState((String)zip);
                              

        if (cityAndState == null) {
            throw new ValidatorException(
                Messages.getMessage("com.corejsf.messages",
                                    "badZip"));
        }
    }
}
