Class TranslationPostMapperMember
java.lang.Object
com.broadleafcommerce.translation.mapping.TranslationPostMapperMember
- All Implemented Interfaces:
com.broadleafcommerce.common.extension.data.DataRoutePartitionAware,com.broadleafcommerce.data.tracking.core.mapping.PostMapper,com.broadleafcommerce.data.tracking.core.mapping.PostMapperMember,org.springframework.core.Ordered
public class TranslationPostMapperMember
extends Object
implements com.broadleafcommerce.data.tracking.core.mapping.PostMapperMember
A post mapper member that attempts to update field values for the projections with any
translations that are found for the given locale and entities.
- Author:
- Chad Harchar (charchar), Jeff Fischer
-
Field Summary
Fields inherited from interface com.broadleafcommerce.common.extension.data.DataRoutePartitionAware
ALL_MATCHFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionTranslationPostMapperMember(com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil behaviorUtil, ContextLocaleHelper contextLocaleHelper) -
Method Summary
Modifier and TypeMethodDescriptionprotected <P> voidapplyTranslations(List<P> projections, List<String> primaryKeys, Locale locale, List<Translation> languageTranslations) protected List<EntityTranslationApplier>protected TranslationHelpervoidsetEntityTranslationAppliers(List<EntityTranslationApplier> entityTranslationAppliers) protected <P> voidsetTranslatedValueInMap(P targetEntity, PathUtil.PathResult item, Object translatedValue) Deprecated, for removal: This API element is subject to removal in a future version.protected <P> voidsetTranslatedValueOnField(P targetEntity, Field field, Object translatedValue) Deprecated, for removal: This API element is subject to removal in a future version.this method is no longer used and the logic has moved toTranslationHelperinstead.voidsetTranslationHelper(TranslationHelper translationHelper) voidsetTranslationService(TranslationEntityService<Translation> translationService) protected <P> voidstandardUpdateField(P businessDomain, Translation translation) Updates field value with translation using the standard field-value-applying logic.<P,D> void transform(List<P> projections, List<D> entities, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected <P> voidupdateField(P businessDomain, Translation translation) Deprecated, for removal: This API element is subject to removal in a future version.this method is no longer used and the logic has moved toTranslationHelperinstead.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.PostMapper
transformMethods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.PostMapperMember
getOrder
-
Constructor Details
-
TranslationPostMapperMember
public TranslationPostMapperMember(com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil behaviorUtil, ContextLocaleHelper contextLocaleHelper)
-
-
Method Details
-
setEntityTranslationAppliers
@Autowired(required=false) public void setEntityTranslationAppliers(@Nullable List<EntityTranslationApplier> entityTranslationAppliers) -
getDataRoutePartition
- Specified by:
getDataRoutePartitionin interfacecom.broadleafcommerce.common.extension.data.DataRoutePartitionAware
-
setTranslationService
@Autowired @Lazy public void setTranslationService(TranslationEntityService<Translation> translationService) -
transform
public <P,D> void transform(List<P> projections, List<D> entities, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
transformin interfacecom.broadleafcommerce.data.tracking.core.mapping.PostMapper
-
applyTranslations
-
standardUpdateField
Updates field value with translation using the standard field-value-applying logic. Delegates toTranslationHelperby default.- Type Parameters:
P- type of the business domain object- Parameters:
businessDomain- a business domain objecttranslation- a field translation that will be applied to a business domain object
-
updateField
@Deprecated(since="TranslationCommon 2.0.5", forRemoval=true) protected <P> void updateField(P businessDomain, Translation translation) Deprecated, for removal: This API element is subject to removal in a future version.this method is no longer used and the logic has moved toTranslationHelperinstead. SeestandardUpdateField(Object, Translation)- Type Parameters:
P- business domain type- Parameters:
businessDomain- business domaintranslation- translation
-
setTranslatedValueOnField
@Deprecated(since="TranslationCommon 2.0.5", forRemoval=true) protected <P> void setTranslatedValueOnField(P targetEntity, Field field, Object translatedValue) Deprecated, for removal: This API element is subject to removal in a future version.this method is no longer used and the logic has moved toTranslationHelperinstead. SeestandardUpdateField(Object, Translation)- Type Parameters:
P- entity type- Parameters:
targetEntity- target entityfield- fieldtranslatedValue- translated value
-
setTranslatedValueInMap
@Deprecated(since="TranslationCommon 2.0.5", forRemoval=true) protected <P> void setTranslatedValueInMap(P targetEntity, PathUtil.PathResult item, Object translatedValue) Deprecated, for removal: This API element is subject to removal in a future version.this method is no longer used and the logic has moved toTranslationHelperinstead. SeestandardUpdateField(Object, Translation)- Type Parameters:
P- target entity type- Parameters:
targetEntity- target entityitem- itemtranslatedValue- value
-
getTranslationHelper
-
setTranslationHelper
-
getEntityTranslationAppliers
-
TranslationHelperinstead.