HeaderColumnNameMappingStrategy by allowing the user to
pass in a map of column names to bean names.
This way the fields in the bean do not have to match the fields in the CSV
file. This is only for when the user passes in the header names
programmatically, and not for annotated beans.
| Access | Constructor and Description |
|---|---|
| public | |
| public | HeaderColumnNameTranslateMappingStrategy(boolean
If set, every record will be shortened
or lengthened to match the number of
headers forceCorrectRecordLength)Constructor to allow setting options for header name mapping. |
| Modifier and Type | Method and Description |
|---|---|
| public Map | Returns: The column mappings of the strategy.Retrieves the column mappings of the strategy. |
| public String | getColumnName(int col)
Overrides com. Get the column name for a given column position. |
| public void | setColumnMapping(Map<String, String>
Source column mapping. columnMapping)Sets the column mapping to those passed in. |
| columnMapping | back to summary |
|---|---|
| private final Map<String, String> columnMapping | |
| HeaderColumnNameTranslateMappingStrategy | back to summary |
|---|---|
| public HeaderColumnNameTranslateMappingStrategy() Default constructor. Considered stable. | |
| HeaderColumnNameTranslateMappingStrategy | back to summary |
|---|---|
| public HeaderColumnNameTranslateMappingStrategy(boolean forceCorrectRecordLength) Constructor to allow setting options for header name mapping.
Not considered stable. As new options are introduced for the mapping
strategy, they will be introduced here. You are encouraged to use
| |
| getColumnMapping | back to summary |
|---|---|
| public Map Retrieves the column mappings of the strategy. | |
| getColumnName | back to summary |
|---|---|
| public String getColumnName(int col) Overrides com. Doc from com. Get the column name for a given column position.
| |
| setColumnMapping | back to summary |
|---|---|
| public void setColumnMapping(Map<String, String> columnMapping) Sets the column mapping to those passed in. | |