Constructor and Description |
---|
UserRoleValidator() |
Modifier and Type | Method and Description |
---|---|
protected UserRoleService<UserRole> |
getUserRoleService() |
protected String |
prefixWithEntityValidationMessageKey(String errorCode) |
void |
setUserRoleService(UserRoleService<UserRole> userRoleService)
Lazy injection since this validator is itself a service component.
|
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) |
void |
validateForReplace(Object businessInstance,
org.springframework.validation.Errors errors,
com.broadleafcommerce.data.tracking.core.context.ContextInfo context) |
protected void |
validateName(org.springframework.validation.Errors errors) |
protected void |
validateParentRoleId(UserRole role,
org.springframework.validation.Errors errors)
Traverses the full ancestry of the role to confirm each ancestor still exists and there are
no cycles, either in the case that the ancestors already had cycles, or in the case that this
role itself causes a cycle.
|
@Autowired @Lazy public void setUserRoleService(UserRoleService<UserRole> userRoleService)
userRoleService
- the role servicepublic boolean supports(Class<?> serviceClass, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
supports
in interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
public void validate(@NonNull Object businessInstance, @NonNull org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
validate
in interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
public void validateForReplace(Object businessInstance, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
validateForReplace
in interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
protected void validateName(org.springframework.validation.Errors errors)
protected void validateParentRoleId(UserRole role, org.springframework.validation.Errors errors)
validateRoleAncestry(UserRole, Errors)
for more
information.role
- the role to validateerrors
- the errors object bound to the role
on which errors can be registeredprotected String prefixWithEntityValidationMessageKey(String errorCode)
protected UserRoleService<UserRole> getUserRoleService()
Copyright © 2021. All rights reserved.