Class EmailConstraintValidator
- java.lang.Object
-
- org.gbif.api.util.validators.email.EmailConstraintValidator
-
- All Implemented Interfaces:
javax.validation.ConstraintValidator<ValidEmail,String>
public class EmailConstraintValidator extends Object implements javax.validation.ConstraintValidator<ValidEmail,String>
ConstraintValidator
that validates emails. Uses apache commonsEmailValidator
Handles
ValidEmail
annotation which is better than defaultEmail
. Default one finds some values valid like: "mail@mail", "mail@mail.e", but this one not.
-
-
Constructor Summary
Constructors Constructor Description EmailConstraintValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
initialize(ValidEmail constraintAnnotation)
boolean
isValid(String value, javax.validation.ConstraintValidatorContext context)
-
-
-
Constructor Detail
-
EmailConstraintValidator
public EmailConstraintValidator()
-
-
Method Detail
-
initialize
public void initialize(ValidEmail constraintAnnotation)
- Specified by:
initialize
in interfacejavax.validation.ConstraintValidator<ValidEmail,String>
-
isValid
public boolean isValid(String value, javax.validation.ConstraintValidatorContext context)
- Specified by:
isValid
in interfacejavax.validation.ConstraintValidator<ValidEmail,String>
-
-