public class EmailValidator extends Object implements ConstraintValidator<Email,CharSequence>
The specification of a valid email can be found in RFC 2822 and one can come up with a regular expression matching all valid email addresses as per specification. However, as this article discusses it is not necessarily practical to implement a 100% compliant email validator. This implementation is a trade-off trying to match most email while ignoring for example emails with double quotes or comments.
Constructor and Description |
---|
EmailValidator() |
Modifier and Type | Method and Description |
---|---|
void |
initialize(Email annotation) |
boolean |
isValid(CharSequence value,
ConstraintValidatorContext context) |
public void initialize(Email annotation)
initialize
in interface ConstraintValidator<Email,CharSequence>
public boolean isValid(CharSequence value, ConstraintValidatorContext context)
isValid
in interface ConstraintValidator<Email,CharSequence>
Copyright © 2007-2014 Red Hat Middleware, LLC. All Rights Reserved