Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
MappingStrategy |
|
| 1.0;1 |
1 | package liquibase.util.csv.opencsv.bean; | |
2 | ||
3 | /** | |
4 | * Copyright 2007 Kyle Miller. | |
5 | * | |
6 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | |
7 | * the License. You may obtain a copy of the License at | |
8 | * | |
9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
10 | * | |
11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | |
12 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | |
13 | * specific language governing permissions and limitations under the License. | |
14 | */ | |
15 | ||
16 | import liquibase.util.csv.opencsv.CSVReader; | |
17 | ||
18 | import java.beans.IntrospectionException; | |
19 | import java.beans.PropertyDescriptor; | |
20 | import java.io.IOException; | |
21 | ||
22 | public interface MappingStrategy { | |
23 | ||
24 | /** | |
25 | * Implementation will have to return a property descriptor from a bean based on the current column. | |
26 | */ | |
27 | public abstract PropertyDescriptor findDescriptor(int col) throws IntrospectionException; | |
28 | ||
29 | public abstract Object createBean() throws InstantiationException, IllegalAccessException; | |
30 | ||
31 | /** | |
32 | * Implemention of this method can grab the header line before parsing begins to use to map columns to bean | |
33 | * properties. | |
34 | */ | |
35 | public void captureHeader(CSVReader reader) throws IOException; | |
36 | ||
37 | } |