Class DataDrivenCartItemProductMapper

java.lang.Object
com.broadleafcommerce.cartoperation.service.mapping.DataDrivenCartItemProductMapper
All Implemented Interfaces:
CartItemProductMapper

public class DataDrivenCartItemProductMapper extends Object implements CartItemProductMapper
  • Constructor Details

    • DataDrivenCartItemProductMapper

      public DataDrivenCartItemProductMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper, CatalogProvider<? extends CatalogItem> catalogProvider)
  • Method Details

    • 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
    • mapFieldsToCartItemAttributes

      protected void mapFieldsToCartItemAttributes(com.broadleafcommerce.cart.client.domain.CartItem cartItem, Object source, List<CartItemMappingProperties.FieldMapping> fieldMappings)
    • 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()
    • getCatalogProvider

      protected CatalogProvider<? extends CatalogItem> getCatalogProvider()
    • getCartItemProductMappingProvider

      protected CartItemProductMappingProvider getCartItemProductMappingProvider()
    • setCartItemProductMappingProvider

      @Autowired public void setCartItemProductMappingProvider(CartItemProductMappingProvider cartItemProductMappingProvider)