Class ProductMetadataPopulator
java.lang.Object
com.hybris.merchandising.converters.populators.ProductMetadataPopulator
- All Implemented Interfaces:
Populator<ProductIndexContainer,Product>
public class ProductMetadataPopulator
extends Object
implements Populator<ProductIndexContainer,Product>
Populates
ProductMetadataPopulator from ProductIndexContainer which encapsulates the information regarding the
indexed product details-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ProductMetadatabuildMetaData(ProductIndexContainer source, LanguageModel language) buildMetaData is a method for building anProductMetadataobject from the source object.protected StringextractFieldValue(ProductIndexContainer source, LanguageModel language, String fieldName) Helper method to extract the merchandising properties based on given languageprotected StringextractLanguage(String translatedField) voidpopulate(ProductIndexContainer source, Product target) Populate the target instance with values from the source instance.protected StringsanitiseField(String field) Sanitise field is a method for URL encoding a field which may contain HTML characters.
-
Field Details
-
NAME_KEY
- See Also:
-
DESCRIPTION_KEY
- See Also:
-
SUMMARY_KEY
- See Also:
-
-
Constructor Details
-
ProductMetadataPopulator
public ProductMetadataPopulator()
-
-
Method Details
-
populate
Populate the target instance with values from the source instance.- Specified by:
populatein interfacePopulator<ProductIndexContainer,Product> - Parameters:
source- the source objecttarget- the target to fill- Throws:
ConversionException- if an error occurs
-
extractFieldValue
protected String extractFieldValue(ProductIndexContainer source, LanguageModel language, String fieldName) Helper method to extract the merchandising properties based on given language- Parameters:
source-ProductIndexContainerrepresenting the Solr index operation.language- theLanguageModelwe wish to retrieve products for.fieldName- the name of the field we wish to retrieve.- Returns:
-
buildMetaData
buildMetaData is a method for building anProductMetadataobject from the source object.- Parameters:
source- theProductIndexContainerrepresenting the Solr index operation.language- theLanguageModelwe wish to retrieve these fields for.- Returns:
- the
ProductMetadataobject representing the metadata.
-
sanitiseField
Sanitise field is a method for URL encoding a field which may contain HTML characters.- Parameters:
field- the field to encode.- Returns:
- the sanitised version.
-
extractLanguage
-