Interface SpecialValueTranslator

All Known Subinterfaces:
NotifiedSpecialValueTranslator
All Known Implementing Classes:
AbstractSpecialValueTranslator, ClassificationAttributeTranslator, ConvertPlaintextToEncodedUserPasswordTranslator, MarketplaceClassificationAttributeTranslator, MarketplaceProductApprovalTranslator, MarketplaceProductCarouselsSynchronizationTranslator, MarketplaceStockTranslator, MediaDataTranslator, MyTranslator, PullMediaDataTranslator, RandomPasswordTranslator, StockTranslator, UserPasswordTranslator, VelocityTranslator

public interface SpecialValueTranslator
This translator class represents a special translator which is only used by SpecialColumnDescriptors, similar to the AbstractValueTranslator which is used by StandardColumnDescriptor. The difference is that the associated SpecialColumnDescriptor does not specify a mapping to an AbstractDescriptor like the StandardColumnDescriptor. So it is not clear when reading the ImpEx script which attribute will be updated. This translator always implements special logic.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    init(SpecialColumnDescriptor columnDescriptor)
    Called once upon header creation to do some initial setup logic.
    boolean
    isEmpty(String cellValue)
    Evaluates whether or not a cell value is treated as empty.
    Called each time an item is exported using the enclosing header.
    void
    performImport(String cellValue, Item processedItem)
    Called each time a non-empty cell value has to be imported.
    void
    Validates the special column definition.
  • Method Details

    • init

      void init(SpecialColumnDescriptor columnDescriptor) throws HeaderValidationException
      Called once upon header creation to do some initial setup logic.
      Parameters:
      columnDescriptor - the newly created column descriptor
      Throws:
      HeaderValidationException - indicates that the column descriptor is not configured properly
    • validate

      void validate(String expr) throws HeaderValidationException
      Validates the special column definition.
      Parameters:
      expr - the definition expression
      Throws:
      HeaderValidationException - if the expression is not valid
    • performExport

      String performExport(Item item) throws ImpExException
      Called each time an item is exported using the enclosing header.
      Parameters:
      item - the item to export
      Returns:
      the string representation of the value to export
      Throws:
      ImpExException - indicates an export error
    • performImport

      void performImport(String cellValue, Item processedItem) throws ImpExException
      Called each time a non-empty cell value has to be imported.
      Parameters:
      cellValue - the cell value string
      processedItem - the item to import the value for
      Throws:
      ImpExException - indicates an import error
    • isEmpty

      boolean isEmpty(String cellValue)
      Evaluates whether or not a cell value is treated as empty.

      Empty cell values are not passed to performImport(String, Item).

      Parameters:
      cellValue - the cell value string
      Returns:
      true if the cell value is empty