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; } Object[] args = {value.toString()}; String pattern = getPattern(); if (pattern == null) { pattern = getPatternExpression(); } else if (pattern != null && pattern.length() <= 0) { pattern = getPatternExpression(); } if(!GenericValidator.matchRegexp(value.toString(),"^"+pattern+"$")){ throw new ValidatorException(getFacesMessage(REGEXPR_MESSAGE_ID, args)); } }
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; } Object[] args = {value.toString()}; String pattern = getPattern(); if (pattern == null) { pattern = getPatternExpression(); } else if (pattern != null && pattern.length() <= 0) { pattern = getPatternExpression(); } if(!GenericValidator.matchRegexp(value.toString(),"^"+pattern+"$")){ throw new ValidatorException(getFacesMessage(REGEXPR_MESSAGE_ID, args)); } }
String pattern = getPattern(); if (pattern == null)