= Pattern.compile(DOMAIN_SPEC);
public void validate(
final FacesContext facesContext, final UIComponent uiComponent, final Object value)
throws ValidatorException {
final EmailAddress emailAddress = (EmailAddress) value;
Matcher matcher = LOCAL_PART_PATTERN.matcher(emailAddress.getLocalPart());
if (!matcher.matches()) {
throw new ValidatorException(MessageUtils.createErrorMessage(
"validatorEmailLocalPart", facesContext));
}
matcher = DOMAIN_PATTERN.matcher(emailAddress.getDomain());
if (!matcher.matches()) {
throw new ValidatorException(MessageUtils.createErrorMessage(
"validatorEmailDomain", facesContext));
}
}