public class EmailConstraintValidator extends Object implements javax.validation.ConstraintValidator<ValidEmail,String>
ConstraintValidator
that validates emails. Uses apache commons EmailValidator
Handles ValidEmail
annotation which is better than default Email
.
Default one finds some values valid like: "mail@mail", "mail@mail.e", but this one not.
Constructor and Description |
---|
EmailConstraintValidator() |
Modifier and Type | Method and Description |
---|---|
void |
initialize(ValidEmail constraintAnnotation) |
boolean |
isValid(String value,
javax.validation.ConstraintValidatorContext context) |
public EmailConstraintValidator()
public void initialize(ValidEmail constraintAnnotation)
initialize
in interface javax.validation.ConstraintValidator<ValidEmail,String>
public boolean isValid(String value, javax.validation.ConstraintValidatorContext context)
isValid
in interface javax.validation.ConstraintValidator<ValidEmail,String>
Copyright © 2024 Global Biodiversity Information Facility (GBIF). All rights reserved.