|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectliquibase.util.csv.opencsv.bean.HeaderColumnNameMappingStrategy<T>
liquibase.util.csv.opencsv.bean.ColumnPositionMappingStrategy<T>
T
- - Type of object that is being processed.public class ColumnPositionMappingStrategy<T>
Allows for the mapping of columns with their positions. Using this strategy requires all the columns to be present in the csv file and for them to be in a particular order. Also this strategy requires that the file does NOT have an header. That said the main use of this strategy is files that do not have headers.
Field Summary |
---|
Fields inherited from class liquibase.util.csv.opencsv.bean.HeaderColumnNameMappingStrategy |
---|
annotationDriven, descriptorMap, determinedIfAnnotationDriven, fieldMap, header, indexLookup, type |
Constructor Summary | |
---|---|
ColumnPositionMappingStrategy()
Default Constructor. |
Method Summary | |
---|---|
void |
captureHeader(CSVReader reader)
Captures the header from the reader - required by the MappingStrategy interface and is a do nothing method for the ColumnPositionMappingStrategy. |
Integer |
getColumnIndex(String name)
gets the column position for a given column name. |
String[] |
getColumnMapping()
Retrieves the column mappings. |
String |
getColumnName(int col)
gets a column name. |
void |
setColumnMapping(String... columnMapping)
Setter for the ColumnMappings. |
Methods inherited from class liquibase.util.csv.opencsv.bean.HeaderColumnNameMappingStrategy |
---|
createBean, createIndexLookup, findDescriptor, findDescriptor, findField, findField, 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 |
Constructor Detail |
---|
public ColumnPositionMappingStrategy()
Method Detail |
---|
public void captureHeader(CSVReader reader) throws IOException
captureHeader
in interface MappingStrategy<T>
captureHeader
in class HeaderColumnNameMappingStrategy<T>
reader
- - CSVReader.
IOException
- - would be thrown by the CSVReader if it was used :)public Integer getColumnIndex(String name)
getColumnIndex
in interface MappingStrategy<T>
getColumnIndex
in class HeaderColumnNameMappingStrategy<T>
name
- the column name
public String getColumnName(int col)
getColumnName
in class HeaderColumnNameMappingStrategy<T>
col
- - position of the column.
public String[] getColumnMapping()
public void setColumnMapping(String... columnMapping)
columnMapping
- - column names to be mapped.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |