Class CategoryProductValidator
java.lang.Object
com.broadleafcommerce.catalog.service.validation.CategoryProductValidator
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
public class CategoryProductValidator
extends Object
implements com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
Validations for
CategoryProduct
.- Author:
- Samarth Dhruva (samarthd)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected CategoryProductService<CategoryProduct>
void
setCategoryProductService
(CategoryProductService<CategoryProduct> categoryProductService) 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) protected void
validateCategory
(org.springframework.validation.Errors errors) protected void
validateCategoryProductDoesNotExist
(@NonNull CategoryProduct businessInstance, @NonNull org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) void
validateForCreate
(@NonNull Object businessInstance, @NonNull org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) protected void
validatePrimary
(CategoryProduct categoryProduct, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected void
validateProduct
(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
validateForReplace, validateForUpdate
-
Constructor Details
-
CategoryProductValidator
public CategoryProductValidator()
-
-
Method Details
-
setCategoryProductService
@Autowired @Lazy public void setCategoryProductService(CategoryProductService<CategoryProduct> categoryProductService) Lazy injection since this validator is itself a service component. This avoids circular dependency exceptions- Parameters:
categoryProductService
- the category product service
-
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
-
validateForCreate
public void validateForCreate(@NonNull @NonNull Object businessInstance, @NonNull @NonNull org.springframework.validation.Errors errors, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) - Specified by:
validateForCreate
in interfacecom.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
-
validateCategory
protected void validateCategory(org.springframework.validation.Errors errors) -
validateProduct
protected void validateProduct(org.springframework.validation.Errors errors) -
validatePrimary
protected void validatePrimary(CategoryProduct categoryProduct, org.springframework.validation.Errors errors, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
validateCategoryProductDoesNotExist
protected void validateCategoryProductDoesNotExist(@NonNull @NonNull CategoryProduct businessInstance, @NonNull @NonNull org.springframework.validation.Errors errors, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getCategoryProductService
-