Class CartModifyingRequestValidator

java.lang.Object
com.broadleafcommerce.cartoperation.web.validator.CartModifyingRequestValidator
All Implemented Interfaces:
CartVersionRequestValidator, RequestValidator

public class CartModifyingRequestValidator extends Object implements CartVersionRequestValidator
Validates cart requests that will modify the cart.
Author:
Jacob Mitash
  • Constructor Details

    • CartModifyingRequestValidator

      public CartModifyingRequestValidator(CartHolder<com.broadleafcommerce.cart.client.domain.Cart> requestCartHolder)
  • Method Details

    • supports

      public boolean supports(Class<?> clazz)
      Description copied from interface: RequestValidator
      Tells whether this validator supports the given type.
      Specified by:
      supports in interface RequestValidator
      Parameters:
      clazz - the class of the instance that will be tested/validated
      Returns:
      true if this validator can support the given type, false otherwise
    • validate

      public void validate(Object rawRequestBody, org.springframework.validation.Errors errors)
      Description copied from interface: RequestValidator
      Validates the given request body.
      Specified by:
      validate in interface RequestValidator
      Parameters:
      rawRequestBody - the request body to validate
      errors - the errors to contribute to when validation errors occur
    • getRequestCartHolder

      protected CartHolder<com.broadleafcommerce.cart.client.domain.Cart> getRequestCartHolder()