liquibase.util.csv.opencsv.bean
Class HeaderColumnNameTranslateMappingStrategy<T>
java.lang.Object
liquibase.util.csv.opencsv.bean.HeaderColumnNameMappingStrategy<T>
liquibase.util.csv.opencsv.bean.HeaderColumnNameTranslateMappingStrategy<T>
- Type Parameters:
T
- - class to be mapped.
- All Implemented Interfaces:
- MappingStrategy<T>
public class HeaderColumnNameTranslateMappingStrategy<T>
- extends HeaderColumnNameMappingStrategy<T>
Expands on 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.
Methods inherited from class liquibase.util.csv.opencsv.bean.HeaderColumnNameMappingStrategy |
captureHeader, createBean, createIndexLookup, findDescriptor, findDescriptor, findField, findField, getColumnIndex, getType, isAnnotationDriven, loadDescriptorMap, loadFieldMap, matches, resetIndexMap, setType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HeaderColumnNameTranslateMappingStrategy
public HeaderColumnNameTranslateMappingStrategy()
- Default constructor.
getColumnName
public String getColumnName(int col)
- Retrieves the column name for a given column position
- Overrides:
getColumnName
in class HeaderColumnNameMappingStrategy<T>
- Parameters:
col
- - column position.
- Returns:
- - The column name.
getColumnMapping
public Map<String,String> getColumnMapping()
- retrieves the column mappings of the strategy.
- Returns:
- - the column mappings of the strategy.
setColumnMapping
public void setColumnMapping(Map<String,String> columnMapping)
- Sets the column mapping to those passed in.
- Parameters:
columnMapping
- - source column mapping.
Copyright © 2016 Liquibase.org. All rights reserved.