| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| ColumnPositionMappingStrategy |
|
| 1.5;1.5 |
| 1 | package liquibase.util.csv.opencsv.bean; | |
| 2 | ||
| 3 | import liquibase.util.csv.CSVReader; | |
| 4 | ||
| 5 | import java.io.IOException; | |
| 6 | ||
| 7 | /** | |
| 8 | * Copyright 2007 Kyle Miller. | |
| 9 | * | |
| 10 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | |
| 11 | * the License. You may obtain a copy of the License at | |
| 12 | * | |
| 13 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 14 | * | |
| 15 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | |
| 16 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | |
| 17 | * specific language governing permissions and limitations under the License. | |
| 18 | */ | |
| 19 | ||
| 20 | 0 | public class ColumnPositionMappingStrategy extends HeaderColumnNameMappingStrategy { |
| 21 | 0 | protected String[] columnMapping = new String[] {}; |
| 22 | ||
| 23 | public void captureHeader(CSVReader reader) throws IOException { | |
| 24 | // do nothing, first line is not header | |
| 25 | 0 | } |
| 26 | ||
| 27 | @Override | |
| 28 | protected String getColumnName(int col) { | |
| 29 | 0 | return (null != columnMapping && col < columnMapping.length) ? columnMapping[col] : null; |
| 30 | } | |
| 31 | ||
| 32 | public String[] getColumnMapping() { | |
| 33 | 0 | return columnMapping; |
| 34 | } | |
| 35 | ||
| 36 | public void setColumnMapping(String[] columnMapping) { | |
| 37 | 0 | this.columnMapping = columnMapping; |
| 38 | 0 | } |
| 39 | } |