Class DefaultSelectorProductTypeValidator

java.lang.Object
com.broadleafcommerce.catalog.service.validation.product.type.DefaultSelectorProductTypeValidator
All Implemented Interfaces:
ProductTypeValidator

public class DefaultSelectorProductTypeValidator extends Object implements ProductTypeValidator
The default validator that validates products whose type is DefaultProductType.SELECTOR.
Author:
Marie Standeven
  • Constructor Details

    • DefaultSelectorProductTypeValidator

      public DefaultSelectorProductTypeValidator()
  • Method Details

    • canValidateCreate

      public boolean canValidateCreate(Product product)
      Description copied from interface: ProductTypeValidator
      Whether or not this validator supports validation to create this product.
      Specified by:
      canValidateCreate in interface ProductTypeValidator
      Parameters:
      product - the product to validate
      Returns:
      true if this validator can validate the product creation
    • canValidateUpdate

      public boolean canValidateUpdate(Product product, Product existingProduct)
      Description copied from interface: ProductTypeValidator
      Whether or not this validator supports validation to update this product.
      Specified by:
      canValidateUpdate in interface ProductTypeValidator
      Parameters:
      product - the product to validate
      Returns:
      true if this validator can validate the product update
    • canValidateReplace

      public boolean canValidateReplace(Product product, Product existingProduct)
      Description copied from interface: ProductTypeValidator
      Whether or not this validator supports validation to replace this product.
      Specified by:
      canValidateReplace in interface ProductTypeValidator
      Parameters:
      product - the product to validate
      Returns:
      true if this validator can validate the product replace
    • validateProductForCreate

      public void validateProductForCreate(Product product, org.springframework.validation.Errors errors, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: ProductTypeValidator
      Validate the product for create.
      Specified by:
      validateProductForCreate in interface ProductTypeValidator
      Parameters:
      product - the product to validate
      errors - holder for validation context information. When adding field validation errors, the field names should be in the context of the product
      context - current context this validation is running in
    • validateProductForUpdate

      public void validateProductForUpdate(Product product, org.springframework.validation.Errors errors, Product existingProduct, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: ProductTypeValidator
      Validate the product for update.
      Specified by:
      validateProductForUpdate in interface ProductTypeValidator
      Parameters:
      product - the product to validate
      errors - holder for validation context information. When adding field validation errors, the field names should be in the context of the product
      existingProduct - the current product in the database
      context - current context this validation is running in
    • validateProductForReplace

      public void validateProductForReplace(Product product, org.springframework.validation.Errors errors, Product existingProduct, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: ProductTypeValidator
      Validate the product for replace.
      Specified by:
      validateProductForReplace in interface ProductTypeValidator
      Parameters:
      product - the product to validate
      errors - holder for validation context information. When adding field validation errors, the field names should be in the context of the product
      existingProduct - the current product in the database
      context - current context this validation is running in
    • validateSelectorProductFields

      protected void validateSelectorProductFields(Product product, org.springframework.validation.Errors errors, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • validateSku

      protected void validateSku(Product product, org.springframework.validation.Errors errors)
    • validateInventoryFields

      protected void validateInventoryFields(Product businessInstance, org.springframework.validation.Errors errors)
    • validatePricingFields

      protected void validatePricingFields(Product businessInstance, org.springframework.validation.Errors errors)
    • validateIncludedProducts

      protected void validateIncludedProducts(Product businessInstance, org.springframework.validation.Errors errors)
    • validateSearchable

      protected void validateSearchable(Product businessInstance, org.springframework.validation.Errors errors)
    • validateProductOptions

      protected void validateProductOptions(Product businessInstance, org.springframework.validation.Errors errors)