Class EmailValidator

java.lang.Object
io.micronaut.validation.validator.constraints.EmailValidator
All Implemented Interfaces:
ConstraintValidator<jakarta.validation.constraints.Email,CharSequence>, jakarta.validation.ConstraintValidator<jakarta.validation.constraints.Email,CharSequence>

@Singleton public class EmailValidator extends Object
Provides Email validation. Largely based off the Hibernate validator implementation.
Author:
Emmanuel Bernard, Hardy Ferentschik, Guillaume Smet, graemerocher
  • Constructor Details

    • EmailValidator

      public EmailValidator()
  • Method Details

    • isValid

      public boolean isValid(@Nullable @Nullable CharSequence value, @NonNull @NonNull io.micronaut.core.annotation.AnnotationValue<jakarta.validation.constraints.Email> annotationMetadata, @NonNull @NonNull ConstraintValidatorContext context)
      Description copied from interface: ConstraintValidator
      Implements the validation logic.

      Implementations should be thread-safe and immutable.

      Parameters:
      value - object to validate
      annotationMetadata - The annotation metadata
      context - The context object
      Returns:
      false if value does not pass the constraint