Class ProductCharacteristicsFieldTranslationHandler

java.lang.Object
com.broadleafcommerce.catalog.service.translation.ProductCharacteristicsFieldTranslationHandler
All Implemented Interfaces:
com.broadleafcommerce.translation.service.TranslationFieldTransformerHandler, org.springframework.core.Ordered

public class ProductCharacteristicsFieldTranslationHandler extends Object implements com.broadleafcommerce.translation.service.TranslationFieldTransformerHandler

The default field transformation logic expects the embedded collection instances to be present on the product instance at the time the translation persistence is engaged. However, we don't want to incur the expense of hydrating characteristics in the translation flow just for this purpose. And in any case, the path transformation is not necessary for ProductCharacteristic, as it is not SubIdentifiable and we use the characteristic name in the translation path, not the ID or the index. Thus, there is no use for the field transformation.

This component simply disables the field transformation logic on all the characteristics translations.

Since:
Catalog Services 2.3.0, ReleaseTrain 2.3.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <P extends com.broadleafcommerce.translation.domain.Translation>
    boolean
    canHandle(String entityType, Object entity, P translation)
     
    <P extends com.broadleafcommerce.translation.domain.Translation>
    void
    handle(String entityType, Object entity, P translation)
    do nothing for product translation characteristics

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.broadleafcommerce.translation.service.TranslationFieldTransformerHandler

    getOrder
  • Field Details

  • Constructor Details

    • ProductCharacteristicsFieldTranslationHandler

      public ProductCharacteristicsFieldTranslationHandler()
  • Method Details

    • handle

      public <P extends com.broadleafcommerce.translation.domain.Translation> void handle(@NonNull String entityType, @NonNull Object entity, @NonNull P translation)
      do nothing for product translation characteristics
      Specified by:
      handle in interface com.broadleafcommerce.translation.service.TranslationFieldTransformerHandler
    • canHandle

      public <P extends com.broadleafcommerce.translation.domain.Translation> boolean canHandle(@NonNull String entityType, @NonNull Object entity, @NonNull P translation)
      Specified by:
      canHandle in interface com.broadleafcommerce.translation.service.TranslationFieldTransformerHandler