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 Details

    • MobileNumberValidator

      public MobileNumberValidator()
  • Method Details

    • supports

      public boolean supports(Class<?> clazz)
      Specified by:
      supports in interface org.springframework.validation.Validator
    • validate

      public void validate(Object object, org.springframework.validation.Errors errors)
      Specified by:
      validate in interface org.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

      protected boolean isVerificationCodeExpired(Date date)
      Check the verification code is expired.
      Parameters:
      date - The time when verification code was creating.
      Returns:
      whether is expired.