Package play.data.validation
Class Constraints.PatternValidator
- Object
-
- play.data.validation.Constraints.Validator<String>
-
- play.data.validation.Constraints.PatternValidator
-
- All Implemented Interfaces:
javax.validation.ConstraintValidator<Constraints.Pattern,String>
- Enclosing class:
- Constraints
public static class Constraints.PatternValidator extends Constraints.Validator<String> implements javax.validation.ConstraintValidator<Constraints.Pattern,String>
Validator for@Pattern
fields.
-
-
Constructor Summary
Constructors Constructor Description PatternValidator()
PatternValidator(String regex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description F.Tuple<String,Object[]>
getErrorMessageKey()
void
initialize(Constraints.Pattern constraintAnnotation)
boolean
isValid(String object)
-
Methods inherited from class play.data.validation.Constraints.Validator
isValid
-
-
-
-
Field Detail
-
message
public static final String message
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PatternValidator
public PatternValidator()
-
PatternValidator
public PatternValidator(String regex)
-
-
Method Detail
-
initialize
public void initialize(Constraints.Pattern constraintAnnotation)
- Specified by:
initialize
in interfacejavax.validation.ConstraintValidator<Constraints.Pattern,String>
-
isValid
public boolean isValid(String object)
- Specified by:
isValid
in classConstraints.Validator<String>
- Parameters:
object
- the value to test.- Returns:
true
if this value is valid.
-
getErrorMessageKey
public F.Tuple<String,Object[]> getErrorMessageKey()
- Specified by:
getErrorMessageKey
in classConstraints.Validator<String>
-
-