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>
Validator for the
Pattern
annotation.- Since:
- 1.2
- Author:
- graemerocher
-
Field Summary
Fields inherited from interface io.micronaut.validation.validator.constraints.ConstraintValidator
VALID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isValid
(@Nullable CharSequence value, @NonNull io.micronaut.core.annotation.AnnotationValue<jakarta.validation.constraints.Pattern> annotationMetadata, @NonNull ConstraintValidatorContext context) Implements the validation logic.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.validation.validator.constraints.ConstraintValidator
isValid
Methods inherited from interface jakarta.validation.ConstraintValidator
initialize
-
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 validateannotationMetadata
- The annotation metadatacontext
- The context object- Returns:
false
ifvalue
does not pass the constraint
-