Class MobileNumberValidator
java.lang.Object
de.hybris.platform.chineseprofile.forms.validation.MobileNumberValidator
- All Implemented Interfaces:
org.springframework.validation.Validator
@Component("mobileNumberValidator")
public class MobileNumberValidator
extends Object
implements org.springframework.validation.Validator
Verify the mobile number before binding and unbinding.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanCheck the verification code is expired.booleanvoidprotected voidvalidateMobileNumber(String mobileNumber, org.springframework.validation.Errors errors) Verify the binding mobile number before saving.protected voidvalidateVerificationCode(String verificationCode, String key, org.springframework.validation.Errors errors) Verify the verification code before saving.
-
Constructor Details
-
MobileNumberValidator
public MobileNumberValidator()
-
-
Method Details
-
supports
- Specified by:
supportsin interfaceorg.springframework.validation.Validator
-
validate
- Specified by:
validatein interfaceorg.springframework.validation.Validator
-
validateMobileNumber
protected void validateMobileNumber(String mobileNumber, org.springframework.validation.Errors errors) Verify the binding mobile number before saving. -
validateVerificationCode
protected void validateVerificationCode(String verificationCode, String key, org.springframework.validation.Errors errors) Verify the verification code before saving. -
isVerificationCodeExpired
Check the verification code is expired.- Parameters:
date- The time when verification code was creating.- Returns:
- whether is expired.
-