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 Details

    • CategoryAssetValidator

      public CategoryAssetValidator()
  • Method Details

    • setCategoryService

      @Autowired @Lazy public void setCategoryService(CategoryService<Category> categoryService)
      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 interface com.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 interface com.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

      @NonNull protected CategoryService<Category> getCategoryService()