Class UserValidator

  • All Implemented Interfaces:
    com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator

    public class UserValidator
    extends Object
    implements com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
    Validations for User.
    Author:
    Samarth Dhruva (samarthd)
    • Constructor Detail

      • UserValidator

        public UserValidator()
    • Method Detail

      • supports

        public boolean supports​(Class<?> serviceClass,
                                com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Specified by:
        supports in interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
      • validate

        public void validate​(@NonNull
                             Object businessInstance,
                             @NonNull
                             org.springframework.validation.Errors errors,
                             com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Specified by:
        validate in interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
      • validateAuthorizationServer

        protected void validateAuthorizationServer​(org.springframework.validation.Errors errors)
      • validateName

        protected void validateName​(org.springframework.validation.Errors errors)
      • noNamePresent

        protected boolean noNamePresent​(org.springframework.validation.Errors errors)
      • getFieldValueOrNull

        protected String getFieldValueOrNull​(org.springframework.validation.Errors errors,
                                             String field)
      • validateEmail

        protected void validateEmail​(org.springframework.validation.Errors errors)
      • validateUsername

        protected void validateUsername​(org.springframework.validation.Errors errors)
      • validateServiceIdAndType

        protected void validateServiceIdAndType​(User user,
                                                org.springframework.validation.Errors errors)