Class PatternValidator

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

@Singleton public class PatternValidator extends Object
Validator for the Pattern annotation.
Since:
1.2
Author:
graemerocher
  • Constructor Details

    • PatternValidator

      public PatternValidator()
  • Method Details

    • isValid

      public boolean isValid(@Nullable @Nullable CharSequence value, @NonNull @NonNull io.micronaut.core.annotation.AnnotationValue<jakarta.validation.constraints.Pattern> 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