Class CategoryAssetValidator
java.lang.Object
com.broadleafcommerce.catalog.service.validation.CategoryAssetValidator
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
public class CategoryAssetValidator
extends Object
implements com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
Validations for
CategoryAsset
.- Author:
- Samarth Dhruva (samarthd)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected CategoryService<Category>
void
setCategoryService
(CategoryService<Category> categoryService) Lazy injection since this validator is itself a service component.boolean
void
validate
(Object businessInstance, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) protected void
validateCategoryId
(String categoryId, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected void
validateType
(org.springframework.validation.Errors errors) protected void
validateUrlAndEmbedCode
(CategoryAsset asset, 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
-
CategoryAssetValidator
public CategoryAssetValidator()
-
-
Method Details
-
setCategoryService
Lazy injection since this validator is itself a service component. This avoids circular dependency exceptions- Parameters:
categoryService
- the category service
-
supports
public boolean supports(Class<?> clazz, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - 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
-
validateCategoryId
protected void validateCategoryId(String categoryId, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
validateType
protected void validateType(org.springframework.validation.Errors errors) -
validateUrlAndEmbedCode
protected void validateUrlAndEmbedCode(CategoryAsset asset, org.springframework.validation.Errors errors) -
getCategoryService
-