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 Detail

      • ProductFeatureValueTranslator

        public ProductFeatureValueTranslator()
    • Method Detail

      • convertToJalo

        protected java.lang.Object convertToJalo​(java.lang.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 java.lang.String convertToString​(java.lang.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