Class PropertyDrivenCartItemProductMapper

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

public class PropertyDrivenCartItemProductMapper extends Object implements CartItemProductMapper
  • Constructor Details

    • PropertyDrivenCartItemProductMapper

      public PropertyDrivenCartItemProductMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper, CartItemMappingProperties cartItemMappingProperties)
  • 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()
    • getCartItemMappingProperties

      protected CartItemMappingProperties getCartItemMappingProperties()