1
|
/**
|
2
|
* Copyright (C) 2017 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.cdm.io.fact.temporal.in;
|
10
|
|
11
|
import java.net.URI;
|
12
|
|
13
|
import eu.etaxonomy.cdm.database.ICdmDataSource;
|
14
|
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer;
|
15
|
import eu.etaxonomy.cdm.io.fact.in.FactExcelImportConfiguratorBase;
|
16
|
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
|
17
|
|
18
|
/**
|
19
|
* Configurator for taxon based temporal data import.
|
20
|
*
|
21
|
* @author a.mueller
|
22
|
* @since 15.07.2020
|
23
|
*/
|
24
|
public class TemporalDataExcelImportConfigurator<ANALYZE extends TemporalDataExcelFormatAnalyzer<?>>
|
25
|
extends FactExcelImportConfiguratorBase<ANALYZE>{
|
26
|
|
27
|
private static final long serialVersionUID = 2413575026028295925L;
|
28
|
|
29
|
private String columnLabelStart = "Start";
|
30
|
private String columnLabelEnd = "End";
|
31
|
|
32
|
public static final TemporalDataExcelImportConfigurator<TemporalDataExcelFormatAnalyzer<?>> NewTemporalInstance(URI uri, ICdmDataSource destination){
|
33
|
return new TemporalDataExcelImportConfigurator<TemporalDataExcelFormatAnalyzer<?>>(uri, destination, null);
|
34
|
}
|
35
|
|
36
|
protected TemporalDataExcelImportConfigurator(URI uri, ICdmDataSource destination, IInputTransformer transformer) {
|
37
|
super(uri, destination, transformer);
|
38
|
}
|
39
|
|
40
|
@SuppressWarnings({ "unchecked" })
|
41
|
@Override
|
42
|
public TemporalDataExcelImportState<?> getNewState() {
|
43
|
return new TemporalDataExcelImportState<>(this);
|
44
|
}
|
45
|
|
46
|
@SuppressWarnings("unchecked")
|
47
|
@Override
|
48
|
protected void makeIoClassList() {
|
49
|
ioClassList = new Class[]{
|
50
|
TemporalDataExcelImport.class,
|
51
|
};
|
52
|
}
|
53
|
|
54
|
/**
|
55
|
* Note: This method needs to be overriden by potential subclasses.
|
56
|
*/
|
57
|
@SuppressWarnings("unchecked")
|
58
|
@Override
|
59
|
public ANALYZE getAnalyzer() {
|
60
|
return (ANALYZE)new TemporalDataExcelFormatAnalyzer(this);
|
61
|
}
|
62
|
|
63
|
@Override
|
64
|
public NomenclaturalCode getNomenclaturalCode() {
|
65
|
NomenclaturalCode result = super.getNomenclaturalCode();
|
66
|
if (result == null){
|
67
|
result = NomenclaturalCode.ICNAFP;
|
68
|
}
|
69
|
return result;
|
70
|
}
|
71
|
|
72
|
public void setRowToNeglect(int row){
|
73
|
|
74
|
}
|
75
|
|
76
|
public String getColumnLabelStart() {
|
77
|
return columnLabelStart;
|
78
|
}
|
79
|
public void setColumnLabelStart(String columnLabelStart) {
|
80
|
this.columnLabelStart = columnLabelStart;
|
81
|
}
|
82
|
|
83
|
public String getColumnLabelEnd() {
|
84
|
return columnLabelEnd;
|
85
|
}
|
86
|
public void setColumnLabelEnd(String columnLabelEnd) {
|
87
|
this.columnLabelEnd = columnLabelEnd;
|
88
|
}
|
89
|
|
90
|
}
|