Class ProductAssetValidator
java.lang.Object
com.broadleafcommerce.catalog.service.validation.ProductAssetValidator
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
public class ProductAssetValidator
extends Object
implements com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
Validations for
ProductAsset.- Author:
- Samarth Dhruva (samarthd)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ProductService<Product>voidsetProductService(ProductService<Product> productService) Lazy injection since this validator is itself a service component.booleanvoidvalidate(Object businessInstance, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) protected voidvalidateProductId(String productId, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected voidvalidateType(org.springframework.validation.Errors errors) protected voidvalidateUrlAndEmbedCode(ProductAsset asset, org.springframework.validation.Errors errors) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
validateForCreate, validateForReplace, validateForUpdate
-
Constructor Details
-
ProductAssetValidator
public ProductAssetValidator()
-
-
Method Details
-
setProductService
Lazy injection since this validator is itself a service component. This avoids circular dependency exceptions- Parameters:
productService- the product service
-
supports
public boolean supports(Class<?> clazz, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
supportsin 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:
validatein interfacecom.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
-
validateProductId
protected void validateProductId(String productId, 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(ProductAsset asset, org.springframework.validation.Errors errors) -
getProductService
-