/** * methode that validates isbn codes. * it uses the commons-validator */ public void validate( FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException { if (facesContext == null) throw new NullPointerException("facesContext"); if (uiComponent == null) throw new NullPointerException("uiComponent"); if (value == null) { return; } if (!isbnValidator.isValid( value.toString())) { Object[] args = {value.toString()}; String message = getMessage(); if (null == message) message = ISBN_MESSAGE_ID; throw new ValidatorException(MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR, message, args)); } }
/** * methode that validates isbn codes. * it uses the commons-validator */ public void validate( FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException { if (facesContext == null) throw new NullPointerException("facesContext"); if (uiComponent == null) throw new NullPointerException("uiComponent"); if (value == null) { return; } if (!isbnValidator.isValid( value.toString())) { Object[] args = {value.toString()}; String message = getMessage(); if (null == message) message = ISBN_MESSAGE_ID; throw new ValidatorException(MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR, message, args)); } }
String message = getMessage(); if (null == message)