}
public void validate(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException {
ResourceBundle bundle = resourceBundleFinder.getForCurrentLocale(facesContext);
ResourceBundleMessageProducer producer = new ResourceBundleMessageProducer(bundle);
NITValidator validator = new NITValidator(producer, formatted);
try {
validator.assertValid(value.toString());
} catch (InvalidStateException e) {
List<ValidationMessage> messages = e.getInvalidMessages();
String firstErrorMessage = messages.remove(0).getMessage();
registerAllMessages(facesContext, uiComponent, messages);
throw new ValidatorException(new FacesMessage(firstErrorMessage));