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 java.lang.Object implements org.springframework.validation.ValidatorVerify the mobile number before binding and unbinding.
-
-
Constructor Summary
Constructors Constructor Description MobileNumberValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanisVerificationCodeExpired(java.util.Date date)Check the verification code is expired.booleansupports(java.lang.Class<?> clazz)voidvalidate(java.lang.Object object, org.springframework.validation.Errors errors)protected voidvalidateMobileNumber(java.lang.String mobileNumber, org.springframework.validation.Errors errors)Verify the binding mobile number before saving.protected voidvalidateVerificationCode(java.lang.String verificationCode, java.lang.String key, org.springframework.validation.Errors errors)Verify the verification code before saving.
-
-
-
Method Detail
-
supports
public boolean supports(java.lang.Class<?> clazz)
- Specified by:
supportsin interfaceorg.springframework.validation.Validator
-
validate
public void validate(java.lang.Object object, org.springframework.validation.Errors errors)- Specified by:
validatein interfaceorg.springframework.validation.Validator
-
validateMobileNumber
protected void validateMobileNumber(java.lang.String mobileNumber, org.springframework.validation.Errors errors)Verify the binding mobile number before saving.
-
validateVerificationCode
protected void validateVerificationCode(java.lang.String verificationCode, java.lang.String key, org.springframework.validation.Errors errors)Verify the verification code before saving.
-
isVerificationCodeExpired
protected boolean isVerificationCodeExpired(java.util.Date date)
Check the verification code is expired.- Parameters:
date- The time when verification code was creating.- Returns:
- whether is expired.
-
-