Interface AccountRoleContextValidator<P extends AccountRole>
-
- All Known Implementing Classes:
DefaultAccountRoleContextValidator
public interface AccountRoleContextValidator<P extends AccountRole>
Various context-related validation functions for use when performing CRUD operations related to an account role.This performs only context-related validations.
AccountRoleValidator
is used for the more basic field validations.- Author:
- Samarth Dhruva (samarthd), Chris Kittrell (ckittrell)
- See Also:
AccountRoleValidator
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.springframework.validation.Errors
validateCreate(P role, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates a create operation is allowed in the current context.void
validateCreate(P role, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates a create operation is allowed in the current context.org.springframework.validation.Errors
validateDelete(P role, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates a delete operation is allowed in the current context.void
validateDelete(P role, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates a delete operation is allowed in the current context.org.springframework.validation.Errors
validateUpdate(String id, P role, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates an update operation is allowed in the current context.void
validateUpdate(String id, P role, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates an update operation is allowed in the current context.
-
-
-
Method Detail
-
validateCreate
org.springframework.validation.Errors validateCreate(P role, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates a create operation is allowed in the current context.- Parameters:
role
- The role to validatecontextInfo
- The current context- Returns:
- An
Errors
object bound to a {code role} - See Also:
validateCreate(AccountRole, Errors, ContextInfo)
-
validateUpdate
org.springframework.validation.Errors validateUpdate(String id, P role, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates an update operation is allowed in the current context.- Parameters:
id
- the id of the role being updated, explicitly provided such that it can be used to find the existing record even ifAccountRole.getId()
is unsupplied inrole
.role
- The role to validatecontextInfo
- The current context- Returns:
- An
Errors
object bound to a {code role} - See Also:
validateUpdate(String, AccountRole, Errors, ContextInfo)
-
validateDelete
org.springframework.validation.Errors validateDelete(P role, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates a delete operation is allowed in the current context.- Parameters:
role
- the role being deleted to validatecontextInfo
- The current context- Returns:
- An
Errors
object bound to a {code role} - See Also:
validateDelete(AccountRole, Errors, ContextInfo)
-
validateCreate
void validateCreate(P role, org.springframework.validation.Errors errors, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates a create operation is allowed in the current context.- Parameters:
role
- The role to validateerrors
- An errors object bound to therole
to be validatedcontextInfo
- The current context
-
validateUpdate
void validateUpdate(String id, P role, org.springframework.validation.Errors errors, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates an update operation is allowed in the current context.- Parameters:
id
- the id of the role being updated, explicitly provided such that it can be used to find the existing record even ifAccountRole.getId()
is unsupplied inrole
.role
- The role to validateerrors
- An errors object bound to therole
to be validatedcontextInfo
- The current context
-
validateDelete
void validateDelete(P role, org.springframework.validation.Errors errors, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates a delete operation is allowed in the current context.- Parameters:
role
- The role being deleted to validateerrors
- An errors object bound to therole
to be validatedcontextInfo
- The current context
-
-