Class TmaCartItemValidator

  • All Implemented Interfaces:
    org.springframework.validation.Validator

    public class TmaCartItemValidator
    extends java.lang.Object
    implements org.springframework.validation.Validator
    Validator for CartItem.
    Since:
    1907
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected TmaPlaceValidator getPlaceValidator()  
      boolean supports​(java.lang.Class<?> aClass)  
      void validate​(java.lang.Object object, org.springframework.validation.Errors errors)  
      protected void validateActions​(CartItem cartItem, org.springframework.validation.Errors errors)
      Checks that the subscribed product and offering are correctly set for the action found on the cartItem.
      protected void validateAddBpo​(CartItem cartItem, org.springframework.validation.Errors errors)
      Checks if BPO added to cart is correct.
      protected void validateAddParameters​(CartItem cartItem, org.springframework.validation.Errors errors)
      Checks if cart item is correct for adding a cartItem.
      protected void validateAddSpo​(CartItem cartItem, org.springframework.validation.Errors errors)
      Checks if SPO added to cart is correct.
      protected void validateChildCartItems​(java.util.List<CartItem> cartItems, org.springframework.validation.Errors errors)  
      protected void validateDeleteParameters​(CartItem cartItem, org.springframework.validation.Errors errors)
      Checks if cart item is correct for deleting a cartItem.
      protected void validateModifyParameters​(CartItem cartItem, org.springframework.validation.Errors errors)
      Checks if cart item is correct for modifying a cartItem.
      protected void validatePlaces​(CartItem cartItem, org.springframework.validation.Errors errors)
      Checks that all the places on product are valid.
      protected void validateQuantity​(java.lang.Integer quantity, java.lang.String fieldName, org.springframework.validation.Errors errors)
      Checks if the quantity of the cart item is correct.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TmaCartItemValidator

        public TmaCartItemValidator​(TmaPlaceValidator placeValidator)
    • Method Detail

      • supports

        public boolean supports​(java.lang.Class<?> aClass)
        Specified by:
        supports in interface org.springframework.validation.Validator
      • validate

        public void validate​(java.lang.Object object,
                             org.springframework.validation.Errors errors)
        Specified by:
        validate in interface org.springframework.validation.Validator
      • validateAddParameters

        protected void validateAddParameters​(CartItem cartItem,
                                             org.springframework.validation.Errors errors)
        Checks if cart item is correct for adding a cartItem.
        Parameters:
        cartItem - the cart item
        errors - the errors found
      • validateModifyParameters

        protected void validateModifyParameters​(CartItem cartItem,
                                                org.springframework.validation.Errors errors)
        Checks if cart item is correct for modifying a cartItem.
        Parameters:
        cartItem - the cart item
        errors - the errors found
      • validateDeleteParameters

        protected void validateDeleteParameters​(CartItem cartItem,
                                                org.springframework.validation.Errors errors)
        Checks if cart item is correct for deleting a cartItem.
        Parameters:
        cartItem - the cart item
        errors - the errors found
      • validateAddSpo

        protected void validateAddSpo​(CartItem cartItem,
                                      org.springframework.validation.Errors errors)
        Checks if SPO added to cart is correct.
        Parameters:
        cartItem - the cart item
        errors - the errors found
      • validateAddBpo

        protected void validateAddBpo​(CartItem cartItem,
                                      org.springframework.validation.Errors errors)
        Checks if BPO added to cart is correct.
        Parameters:
        cartItem - the cart item
        errors - the errors found
      • validateChildCartItems

        protected void validateChildCartItems​(java.util.List<CartItem> cartItems,
                                              org.springframework.validation.Errors errors)
      • validateQuantity

        protected void validateQuantity​(java.lang.Integer quantity,
                                        java.lang.String fieldName,
                                        org.springframework.validation.Errors errors)
        Checks if the quantity of the cart item is correct.
        Parameters:
        quantity - the quantity of the cart item
        errors - the errors found
      • validatePlaces

        protected void validatePlaces​(CartItem cartItem,
                                      org.springframework.validation.Errors errors)
        Checks that all the places on product are valid.
        Parameters:
        cartItem - the cart item
        errors - the errors found
      • validateActions

        protected void validateActions​(CartItem cartItem,
                                       org.springframework.validation.Errors errors)
        Checks that the subscribed product and offering are correctly set for the action found on the cartItem.
        Parameters:
        cartItem - the input cartItem