Class PropertyDrivenCartItemProductMapper
java.lang.Object
com.broadleafcommerce.cartoperation.service.mapping.PropertyDrivenCartItemProductMapper
- All Implemented Interfaces:
CartItemProductMapper
-
Constructor Summary
ConstructorDescriptionPropertyDrivenCartItemProductMapper
(com.fasterxml.jackson.databind.ObjectMapper objectMapper, CartItemMappingProperties cartItemMappingProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected CartItemMappingProperties
protected com.fasterxml.jackson.databind.ObjectMapper
protected void
mapFieldsToCartItemAttributes
(com.broadleafcommerce.cart.client.domain.CartItem cartItem, Object source, List<CartItemMappingProperties.FieldMapping> fieldMappings) protected void
mapFieldToCartItemAttribute
(com.broadleafcommerce.cart.client.domain.CartItem cartItem, com.jayway.jsonpath.DocumentContext context, String attributeName, String valuePath) void
mapProductToCartItem
(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull Product product, Variant variant, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) void
mapProductToCartItem
(com.broadleafcommerce.cart.client.domain.CartItem cartItem, Product product, Variant variant) protected Object
readValueByPath
(com.jayway.jsonpath.DocumentContext context, String path)
-
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
- Specified by:
mapProductToCartItem
in interfaceCartItemProductMapper
- Parameters:
cartItem
- the cart item to map information intoproduct
- the product to map information fromvariant
- 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
- Specified by:
mapProductToCartItem
in interfaceCartItemProductMapper
- Parameters:
cartItem
- the cart item to map information intoproduct
- the product to map information fromvariant
- the variant to map information from, if availablecontextInfo
- 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
-
readValueByPath
-
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
getCartItemMappingProperties
-