Class ProductCharacteristicSkippingTranslationApplier
java.lang.Object
com.broadleafcommerce.catalog.service.translation.ProductCharacteristicSkippingTranslationApplier
- All Implemented Interfaces:
com.broadleafcommerce.translation.mapping.EntityTranslationApplier,org.springframework.core.Ordered
public class ProductCharacteristicSkippingTranslationApplier
extends Object
implements com.broadleafcommerce.translation.mapping.EntityTranslationApplier
Goal is to skip translation from happening in
TranslationPostMapperMember because we
manually apply it via
CharacteristicsTranslationService.applyConsolidatedCharacteristicsTranslationsToProduct(com.broadleafcommerce.catalog.domain.product.Product, com.broadleafcommerce.catalog.service.product.hydration.ResolvedProductReferences, com.broadleafcommerce.data.tracking.core.context.ContextInfo),
once hydrated characteristics are actually set on the product instance- Since:
- CatalogServices 2.3.0, ReleaseTrain 2.3.0
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanShould be applied only for product AND characteristics fields.voidDo nothing, as at the time this is invoked fromTranslationPostMapperMember, the characteristics are not populated yet, as they are hydrated inProductHydrationServiceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.translation.mapping.EntityTranslationApplier
getOrder
-
Constructor Details
-
ProductCharacteristicSkippingTranslationApplier
public ProductCharacteristicSkippingTranslationApplier()
-
-
Method Details
-
canHandle
public boolean canHandle(Object projection, com.broadleafcommerce.translation.domain.Translation translation) Should be applied only for product AND characteristics fields.- Specified by:
canHandlein interfacecom.broadleafcommerce.translation.mapping.EntityTranslationApplier- Parameters:
projection- business domain projectiontranslation- translation for that projection- Returns:
- if this applier can handle the projection and translation
-
handle
public void handle(Object projection, com.broadleafcommerce.translation.domain.Translation translation) Do nothing, as at the time this is invoked fromTranslationPostMapperMember, the characteristics are not populated yet, as they are hydrated inProductHydrationService- Specified by:
handlein interfacecom.broadleafcommerce.translation.mapping.EntityTranslationApplier- Parameters:
projection- business domain projectiontranslation- translation for that projection
-