Class PropertyDrivenCartItemProductMapper

    • Constructor Detail

      • PropertyDrivenCartItemProductMapper

        public PropertyDrivenCartItemProductMapper​(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                                   CartItemMappingProperties cartItemMappingProperties)
    • Method Detail

      • mapProductToCartItem

        public void mapProductToCartItem​(com.broadleafcommerce.cart.client.domain.CartItem cartItem,
                                         Product product,
                                         Variant variant)
        Description copied from interface: CartItemProductMapper
        Maps specific Product and Variant information into the CartItem.
        Specified by:
        mapProductToCartItem in interface CartItemProductMapper
        Parameters:
        cartItem - the cart item to map information into
        product - the product to map information from
        variant - the variant to map information from, if available
      • mapProductToCartItem

        public void mapProductToCartItem​(@NonNull
                                         @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
                                         @NonNull
                                         @NonNull Product product,
                                         @Nullable
                                         Variant variant,
                                         @Nullable
                                         com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: CartItemProductMapper
        Maps specific Product and Variant information into the CartItem.
        Specified by:
        mapProductToCartItem in interface CartItemProductMapper
        Parameters:
        cartItem - the cart item to map information into
        product - the product to map information from
        variant - the variant to map information from, if available
        contextInfo - Context information around sandbox and multitenant state
      • mapFieldToCartItemAttribute

        protected void mapFieldToCartItemAttribute​(com.broadleafcommerce.cart.client.domain.CartItem cartItem,
                                                   com.jayway.jsonpath.DocumentContext context,
                                                   String attributeName,
                                                   String valuePath)
      • readValueByPath

        @Nullable
        protected Object readValueByPath​(com.jayway.jsonpath.DocumentContext context,
                                         @Nullable
                                         String path)
      • getObjectMapper

        protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()