public interface HeaderNameMapper
Transforms a header from what is given in the CSV file to how that should actually be represented in the system. An example of this is to transform columns that are friendly names (like 'Name') into their actual property representation ('Name' -> 'defaultSku.name'). It is also acceptable to not process headers at all if the CSV is already expected to be in the correct format.
A HeaderNameMapper
is associated to the CSVFileImportProcessor
to process CSV column headers before the
CSV file is read. Multiple HeaderNameMapper
s can exist in the system and are ordered according to Spring's Order
annotation.
Once there is a HeaderNameMapper
that returns a non-null header, that is the header value used.
CSVFileImportProcessor}
Modifier and Type | Method and Description |
---|---|
String |
transformHeader(String header,
ImportType importType)
Transform the given original header from the CSV file import into the system representation of that header.
|
String transformHeader(String header, ImportType importType)
header
- the header parsed directly from the CSV fileimportType
- the type of import that is being performedHeaderNameMapper
Copyright © 2020. All rights reserved.