@Singleton public class PatternValidator extends Object
Pattern
annotation.VALID
Constructor and Description |
---|
PatternValidator() |
Modifier and Type | Method and Description |
---|---|
boolean |
isValid(CharSequence value,
AnnotationValue<Pattern> annotationMetadata,
ConstraintValidatorContext context)
Implements the validation logic.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isValid
initialize
public boolean isValid(@Nullable CharSequence value, @NonNull AnnotationValue<Pattern> annotationMetadata, @NonNull ConstraintValidatorContext context)
ConstraintValidator
Implementations should be thread-safe and immutable.
value
- object to validateannotationMetadata
- The annotation metadatacontext
- The context objectfalse
if value
does not pass the constraint