Class UserValidator
java.lang.Object
com.broadleafcommerce.auth.resource.service.validation.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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
getFieldValueOrNull
(org.springframework.validation.Errors errors, String field) protected UserPermissionService<UserPermission>
protected boolean
noNamePresent
(org.springframework.validation.Errors errors) void
setPermissionService
(UserPermissionService<UserPermission> permissionService) boolean
supports
(Class<?> serviceClass, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) void
validate
(Object businessInstance, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) protected void
validateAuthorizationServer
(org.springframework.validation.Errors errors) protected void
validateEmail
(org.springframework.validation.Errors errors) protected void
validateName
(org.springframework.validation.Errors errors) protected void
validatePermissions
(User businessInstance, org.springframework.validation.Errors errors) protected void
validateServiceIdAndType
(User user, org.springframework.validation.Errors errors) protected void
validateUsername
(org.springframework.validation.Errors errors) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
validateForCreate, validateForReplace, validateForUpdate
-
Constructor Details
-
UserValidator
public UserValidator()
-
-
Method Details
-
setPermissionService
@Autowired @Lazy public void setPermissionService(UserPermissionService<UserPermission> permissionService) -
supports
public boolean supports(Class<?> serviceClass, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) - Specified by:
supports
in interfacecom.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 interfacecom.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
-
validatePermissions
protected void validatePermissions(User businessInstance, org.springframework.validation.Errors errors) -
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
-
validateEmail
protected void validateEmail(org.springframework.validation.Errors errors) -
validateUsername
protected void validateUsername(org.springframework.validation.Errors errors) -
validateServiceIdAndType
-
getPermissionService
-