Class DefaultAttributeValueToRepresentationStrategy
java.lang.Object
de.hybris.platform.cmsfacades.cmsitems.converter.DefaultAttributeValueToRepresentationStrategy
- All Implemented Interfaces:
AttributeValueToRepresentationStrategy
public class DefaultAttributeValueToRepresentationStrategy
extends Object
implements AttributeValueToRepresentationStrategy
This class is used by the
DefaultCMSItemConverter to convert items into a representation suited for admin
purposes, like CMS.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertLocalizedValue(AttributeDescriptorModel attribute, Map<String, Object> languageValueMap, Function<Object, Object> transform) protected CloneComponentContextProvidergetCollectionGetter(AttributeDescriptorModel attribute, ItemModel sourceModel, Function<Object, Object> goDeeperOrSerialize) This function is used to retrieve aSupplierthat can be used to get the representation of a collection stored in an attribute.protected CollectionToRepresentationConvertergetLocalizedCollectionGetter(AttributeDescriptorModel attribute, ItemModel sourceModel, Function<Object, Object> goDeeperOrSerialize) This function is used to retrieve aSupplierthat can be used to get the representation of a localized collection value stored in an attribute.getLocalizedGetter(AttributeDescriptorModel attribute, ItemModel sourceModel, Function<Object, Object> goDeeperOrSerialize) This function is used to retrieve aSupplierthat can be used to get the representation of a localized value stored in an attribute.protected LocalizedPopulatorprotected ModelServicegetSimpleGetter(AttributeDescriptorModel attribute, ItemModel sourceModel, Function<Object, Object> goDeeperOrSerialize) This function is used to retrieve a Supplier that can be used to get the representation of the value of an attribute.protected ValidationErrorsProvidervoidsetCloneComponentContextProvider(CloneComponentContextProvider cloneComponentContextProvider) voidsetCollectionToRepresentationConverter(CollectionToRepresentationConverter collectionToRepresentationConverter) voidsetLocalizedPopulator(LocalizedPopulator localizedPopulator) voidsetModelService(ModelService modelService) voidsetValidationErrorsProvider(ValidationErrorsProvider validationErrorsProvider)
-
Constructor Details
-
DefaultAttributeValueToRepresentationStrategy
public DefaultAttributeValueToRepresentationStrategy()
-
-
Method Details
-
getSimpleGetter
public Supplier<Object> getSimpleGetter(AttributeDescriptorModel attribute, ItemModel sourceModel, Function<Object, Object> goDeeperOrSerialize) Description copied from interface:AttributeValueToRepresentationStrategyThis function is used to retrieve a Supplier that can be used to get the representation of the value of an attribute. This representation is generated by applying the provided transformation function.- Specified by:
getSimpleGetterin interfaceAttributeValueToRepresentationStrategy- Parameters:
attribute- The object describing the attribute whose value will be transformed.sourceModel- The model containing the value that will be transformed.goDeeperOrSerialize- The function that will be used to transform the value into the expected object.- Returns:
- A
Supplier. Use get() to retrieve the transformed object.
-
getCollectionGetter
public Supplier<Object> getCollectionGetter(AttributeDescriptorModel attribute, ItemModel sourceModel, Function<Object, Object> goDeeperOrSerialize) Description copied from interface:AttributeValueToRepresentationStrategyThis function is used to retrieve aSupplierthat can be used to get the representation of a collection stored in an attribute. This representation is generated by leveraging the provided transformation function.- Specified by:
getCollectionGetterin interfaceAttributeValueToRepresentationStrategy- Parameters:
attribute- The object describing the attribute whose value will be transformed.sourceModel- The model containing the collection that will be transformed.goDeeperOrSerialize- The function that will be used to transform the collection into the expected representation.- Returns:
- A
Supplier. Use get() to retrieve the transformed collection.
-
getLocalizedGetter
public Supplier<Object> getLocalizedGetter(AttributeDescriptorModel attribute, ItemModel sourceModel, Function<Object, Object> goDeeperOrSerialize) Description copied from interface:AttributeValueToRepresentationStrategyThis function is used to retrieve aSupplierthat can be used to get the representation of a localized value stored in an attribute. This representation is generated by leveraging the provided transformation function.- Specified by:
getLocalizedGetterin interfaceAttributeValueToRepresentationStrategy- Parameters:
attribute- The object describing the attribute whose value will be transformed.sourceModel- The model containing the localized value that will be transformed.goDeeperOrSerialize- The function that will be used to transform the localized value into the expected representation.- Returns:
- A
Supplier. Use get() to retrieve the transformed localized value.
-
getLocalizedCollectionGetter
public Supplier<Object> getLocalizedCollectionGetter(AttributeDescriptorModel attribute, ItemModel sourceModel, Function<Object, Object> goDeeperOrSerialize) Description copied from interface:AttributeValueToRepresentationStrategyThis function is used to retrieve aSupplierthat can be used to get the representation of a localized collection value stored in an attribute. This representation is generated by leveraging the provided transformation function.- Specified by:
getLocalizedCollectionGetterin interfaceAttributeValueToRepresentationStrategy- Parameters:
attribute- The object describing the attribute whose value will be transformed.sourceModel- The model containing the localized collection value that will be transformed.goDeeperOrSerialize- The function that will be used to transform the localized collection value into the expected representation.- Returns:
- A
Supplier. Use get() to retrieve the transformed localized collection value.
-
convertLocalizedValue
-
getModelService
-
setModelService
-
getCollectionToRepresentationConverter
-
setCollectionToRepresentationConverter
public void setCollectionToRepresentationConverter(CollectionToRepresentationConverter collectionToRepresentationConverter) -
getValidationErrorsProvider
-
setValidationErrorsProvider
-
getCloneComponentContextProvider
-
setCloneComponentContextProvider
public void setCloneComponentContextProvider(CloneComponentContextProvider cloneComponentContextProvider) -
getLocalizedPopulator
-
setLocalizedPopulator
-