Class 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 Details

    • ProductFeatureValueTranslator

      public ProductFeatureValueTranslator()
  • Method Details

    • init

      public void init(StandardColumnDescriptor columnDescriptor)
      Description copied from class: AbstractValueTranslator
      Called once per header creation to allow configuring this translator using column modifiers etc.
      Overrides:
      init in class AbstractValueTranslator
      Parameters:
      columnDescriptor - descriptor where the value to translate belongs to
    • convertToJalo

      protected Object convertToJalo(String valueExpr, Item forItem)
      Description copied from class: SingleValueTranslator
      Converts a non-null and non-empty string into a jalo attribute value.
      Specified by:
      convertToJalo in class SingleValueTranslator
      Parameters:
      valueExpr - string to translate
      forItem - item instance the translated value will be set to as attribute
      Returns:
      Object translated value
    • convertToString

      protected String convertToString(Object value)
      Description copied from class: SingleValueTranslator
      Converts a non-null jalo attribute value into its string representation.
      Specified by:
      convertToString in class SingleValueTranslator
      Parameters:
      value - value to translate
      Returns:
      translated value