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 TypeMethodDescriptionvoidinit(SpecialColumnDescriptor columnDescriptor) Called once upon header creation to do some initial setup logic.booleanEvaluates whether or not a cell value is treated as empty.performExport(Item item) Called each time an item is exported using the enclosing header.voidperformImport(String cellValue, Item processedItem) Called each time a non-empty cell value has to be imported.voidValidates the special column definition.
-
Method Details
-
init
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
Validates the special column definition.- Parameters:
expr- the definition expression- Throws:
HeaderValidationException- if the expression is not valid
-
performExport
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
Called each time a non-empty cell value has to be imported.- Parameters:
cellValue- the cell value stringprocessedItem- the item to import the value for- Throws:
ImpExException- indicates an import error
-
isEmpty
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:
trueif the cell value is empty
-