Project

General

Profile

Download (3.13 KB) Statistics
| Branch: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2007 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10

    
11
package eu.etaxonomy.cdm.io.redlist.gefaesspflanzen;
12

    
13
import org.apache.log4j.Logger;
14

    
15
import eu.etaxonomy.cdm.io.common.mapping.InputTransformerBase;
16
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException;
17
import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType;
18
import eu.etaxonomy.cdm.model.name.Rank;
19

    
20
/**
21
 *
22
 * @author pplitzner
23
 * @date Mar 1, 2016
24
 *
25
 */
26
@SuppressWarnings("serial")
27
public final class RedListGefaesspflanzenTransformer extends InputTransformerBase {
28

    
29
    @SuppressWarnings("unused")
30
	private static final Logger logger = Logger.getLogger(RedListGefaesspflanzenTransformer.class);
31

    
32
    @Override
33
    public Rank getRankByKey(String key) throws UndefinedTransformerMethodException {
34
        if (key == null){return null;}
35
        if (key.equals("GAT")){return Rank.GENUS();}
36
        else if (key.equals("SPE")){return Rank.SPECIES();}
37
        else if (key.equals("VAR")){return Rank.VARIETY();}
38
        else if (key.equals("SSP")){return Rank.SUBSPECIES();}
39
        else if (key.equals("FOR")){return Rank.FORM();}
40
        else if (key.equals("RAC")){return Rank.RACE();}
41
        else if (key.equals("SEC")){return Rank.SECTION_BOTANY();}
42
        else if (key.equals("SSE")){return Rank.SUBSECTION_BOTANY();}
43
        else if (key.equals("SGE")){return Rank.SUBGENUS();}
44
        else if (key.equals("SVA")){return Rank.SUBVARIETY();}
45
        else if (key.equals("CV")){return Rank.CULTIVAR();}
46
        else if (key.equals("PRO")){return Rank.PROLES();}
47
        else if (key.equals("SER")){return Rank.SERIES();}
48
        else if (key.equals("GRE")){return Rank.GREX();}
49
        else if (key.equals("AGG")){return Rank.SPECIESAGGREGATE();}
50
        else if (key.equals("GRO") || key.equals("GRU")){return Rank.SPECIESGROUP();}
51
        else if (key.equals("ORA")){return null;}
52
        else if (key.equals("?")){return Rank.UNKNOWN_RANK();}
53
        return null;
54
    }
55

    
56
    @Override
57
    public NomenclaturalStatusType getNomenclaturalStatusByKey(String key) throws UndefinedTransformerMethodException {
58
        if (key == null){return null;}
59
        if (key.equals("nom. cons.")){return NomenclaturalStatusType.CONSERVED();}
60
        else if (key.equals("nom. illeg.")){return NomenclaturalStatusType.ILLEGITIMATE();}
61
        else if (key.equals("nom. inval.")){return NomenclaturalStatusType.INVALID();}
62
        else if (key.equals("nom. ambig.")){return NomenclaturalStatusType.AMBIGUOUS();}
63
        else if (key.equals("nom. nud.")){return NomenclaturalStatusType.NUDUM();}
64
        else if (key.equals("nom. rejic.")){return NomenclaturalStatusType.REJECTED();}
65
        else if (key.equals("nom. utique rejic.")){return NomenclaturalStatusType.UTIQUE_REJECTED();}
66
        else if (key.equals("nom. utique rejic. pro.")){return NomenclaturalStatusType.UTIQUE_REJECTED_PROP();}
67
        else if (key.equals("comb. nov.")){return NomenclaturalStatusType.COMB_NOV();}
68
        return null;
69
    }
70

    
71
}
(6-6/7)