Project

General

Profile

Download (2.34 KB) Statistics
| Branch: | Tag: | Revision:
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.textdata.in;
10

    
11
import eu.etaxonomy.cdm.common.URI;
12
import java.util.UUID;
13

    
14
import eu.etaxonomy.cdm.database.ICdmDataSource;
15
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer;
16
import eu.etaxonomy.cdm.io.fact.in.FactExcelImportConfiguratorBase;
17
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
18

    
19
/**
20
 * Configurator for taxon related text based factual data.
21
 *
22
 * @author a.mueller
23
 * @since 06.07.2020
24
 */
25
public class TextDataExcelImportConfigurator
26
        extends FactExcelImportConfiguratorBase<TextDataExcelFormatAnalyzer>{
27

    
28
    private static final long serialVersionUID = 6327798120129619332L;
29

    
30
    private UUID textLanguageUuid;
31

    
32
    public static TextDataExcelImportConfigurator NewInstance(URI uri, ICdmDataSource destination){
33
        return new TextDataExcelImportConfigurator(uri, destination, null);
34
    }
35

    
36
    private TextDataExcelImportConfigurator(URI uri, ICdmDataSource destination, IInputTransformer transformer) {
37
        super(uri, destination, transformer);
38
    }
39

    
40
    @SuppressWarnings("unchecked")
41
    @Override
42
    public TextDataExcelImportState getNewState() {
43
        return new TextDataExcelImportState(this);
44
    }
45

    
46
    @SuppressWarnings("unchecked")
47
    @Override
48
    protected void makeIoClassList() {
49
        ioClassList = new Class[]{
50
                TextDataExcelImport.class,
51
        };
52
    }
53

    
54
    @Override
55
    public TextDataExcelFormatAnalyzer getAnalyzer() {
56
        return new TextDataExcelFormatAnalyzer(this);
57
    }
58

    
59

    
60
    @Override
61
    public NomenclaturalCode getNomenclaturalCode() {
62
        NomenclaturalCode result = super.getNomenclaturalCode();
63
        if (result == null){
64
            result = NomenclaturalCode.ICNAFP;
65
        }
66
        return result;
67
    }
68

    
69
    public void setTextColumnLabel(String label) {
70
        putLabelReplacement(TextDataExcelImport.COL_TEXT, label);
71
    }
72

    
73
    public void setRowToNeglect(int row){
74

    
75
    }
76

    
77
    public UUID getTextLanguageUuid() {
78
        return textLanguageUuid;
79
    }
80
    public void setTextLanguageUuid(UUID textLanguageUuid) {
81
        this.textLanguageUuid = textLanguageUuid;
82
    }
83

    
84
}
(3-3/4)