Class ProductFeatureValueTranslator
- java.lang.Object
-
- de.hybris.platform.impex.jalo.translators.AbstractValueTranslator
-
- de.hybris.platform.impex.jalo.translators.SingleValueTranslator
-
- de.hybris.platform.catalog.jalo.classification.impex.ProductFeatureValueTranslator
-
public class ProductFeatureValueTranslator extends SingleValueTranslator
Translator for translating the attribute 'value' of type ProductFeature.
Will export a value by exporting the type of the value and the value itself delimited by the configured collection value delimiter. So a feature value 'test' of type string will be exported as 'string,test'.
The supported types are: string, number, boolean, enum, date. When using the enum type, the exported value will contain the classification system and version too.
For example a value 'test' of type enum of classification system 'mySystem' and version 'myVersion' will be exported as 'enum,mySystem,myVersion,test'.
The import assumes the format of the export as input.- Since:
- 3.0-u6
-
-
Constructor Summary
Constructors Constructor Description ProductFeatureValueTranslator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.ObjectconvertToJalo(java.lang.String valueExpr, Item forItem)Converts a non-null and non-empty string into a jalo attribute value.protected java.lang.StringconvertToString(java.lang.Object value)Converts a non-null jalo attribute value into its string representation.voidinit(StandardColumnDescriptor columnDescriptor)Called once per header creation to allow configuring this translator using column modifiers etc.-
Methods inherited from class de.hybris.platform.impex.jalo.translators.SingleValueTranslator
exportValue, getEmptyValue, importValue, isEmpty
-
Methods inherited from class de.hybris.platform.impex.jalo.translators.AbstractValueTranslator
clearStatus, createTranslator, createTranslator, createTranslator, debug, error, getColumnDescriptor, getFlexibleSearch, info, isDebugEnabled, isInfoEnabled, setEmpty, setError, validate, warn, wasEmpty, wasUnresolved
-
-
-
-
Method Detail
-
init
public void init(StandardColumnDescriptor columnDescriptor)
Description copied from class:AbstractValueTranslatorCalled once per header creation to allow configuring this translator using column modifiers etc.- Overrides:
initin classAbstractValueTranslator- Parameters:
columnDescriptor- descriptor where the value to translate belongs to
-
convertToJalo
protected java.lang.Object convertToJalo(java.lang.String valueExpr, Item forItem)Description copied from class:SingleValueTranslatorConverts a non-null and non-empty string into a jalo attribute value.- Specified by:
convertToJaloin classSingleValueTranslator- Parameters:
valueExpr- string to translateforItem- item instance the translated value will be set to as attribute- Returns:
- Object translated value
-
convertToString
protected java.lang.String convertToString(java.lang.Object value)
Description copied from class:SingleValueTranslatorConverts a non-null jalo attribute value into its string representation.- Specified by:
convertToStringin classSingleValueTranslator- Parameters:
value- value to translate- Returns:
- translated value
-
-