- java.lang.Object
-
- io.rxmicro.validation.validator.PatternConstraintValidator
-
- All Implemented Interfaces:
ConstraintValidator<String>
public class PatternConstraintValidator extends Object implements ConstraintValidator<String>
Validator for thePatternconstraint.- Since:
- 0.1
- Author:
- nedis
- See Also:
Pattern
-
-
Constructor Summary
Constructors Constructor Description PatternConstraintValidator(String regex, Collection<Pattern.Flag> flags)Creates the default instance ofPatternConstraintValidatorwith the specified parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidvalidate(String actual, HttpModelType httpModelType, String modelName)Validates the single actual.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.rxmicro.validation.ConstraintValidator
validate, validateList, validateList
-
-
-
-
Constructor Detail
-
PatternConstraintValidator
public PatternConstraintValidator(String regex, Collection<Pattern.Flag> flags)
Creates the default instance ofPatternConstraintValidatorwith the specified parameters.- Parameters:
regex- the specified regular expressionflags- the match flags- See Also:
Pattern.UNIX_LINES,Pattern.CASE_INSENSITIVE,Pattern.COMMENTS,Pattern.MULTILINE,Pattern.DOTALL,Pattern.UNICODE_CASE,Pattern.CANON_EQ
-
-
Method Detail
-
validate
public void validate(String actual, HttpModelType httpModelType, String modelName)
Description copied from interface:ConstraintValidatorValidates the single actual.The state of the
actualmust not be altered.- Specified by:
validatein interfaceConstraintValidator<String>- Parameters:
actual- the actual value to validatehttpModelType- the http model typemodelName- the parameter or header name
-
-