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
|
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
|
20
|
|
21
|
/**
|
22
|
*
|
23
|
* @author pplitzner
|
24
|
* @date Mar 1, 2016
|
25
|
*
|
26
|
*/
|
27
|
@SuppressWarnings("serial")
|
28
|
public final class RedListGefaesspflanzenTransformer extends InputTransformerBase {
|
29
|
|
30
|
@SuppressWarnings("unused")
|
31
|
private static final Logger logger = Logger.getLogger(RedListGefaesspflanzenTransformer.class);
|
32
|
|
33
|
@Override
|
34
|
public Rank getRankByKey(String key) throws UndefinedTransformerMethodException {
|
35
|
if (key == null){return null;}
|
36
|
if (key.equals("GAT")){return Rank.GENUS();}
|
37
|
else if (key.equals("SPE")){return Rank.SPECIES();}
|
38
|
else if (key.equals("VAR")){return Rank.VARIETY();}
|
39
|
else if (key.equals("SSP")){return Rank.SUBSPECIES();}
|
40
|
else if (key.equals("FOR")){return Rank.FORM();}
|
41
|
else if (key.equals("RAC")){return Rank.RACE();}
|
42
|
else if (key.equals("SEC")){return Rank.SECTION_BOTANY();}
|
43
|
else if (key.equals("SSE")){return Rank.SUBSECTION_BOTANY();}
|
44
|
else if (key.equals("SGE")){return Rank.SUBGENUS();}
|
45
|
else if (key.equals("SVA")){return Rank.SUBVARIETY();}
|
46
|
else if (key.equals("CV")){return Rank.CULTIVAR();}
|
47
|
else if (key.equals("PRO")){return Rank.PROLES();}
|
48
|
else if (key.equals("SER")){return Rank.SERIES();}
|
49
|
else if (key.equals("GRE")){return Rank.GREX();}
|
50
|
else if (key.equals("AGG")){return Rank.SPECIESAGGREGATE();}
|
51
|
else if (key.equals("SFO")){return Rank.SUBFORM();}
|
52
|
else if (key.equals("FAM")){return Rank.FAMILY();}
|
53
|
else if (key.equals("SLU")){return Rank.SUBLUSUS();}
|
54
|
//FIXME implement ranks
|
55
|
// else if (key.equals("LUS")){return Rank.LUSUS();}
|
56
|
// else if (key.equals("SPR")){return Rank.SUBPROLES();}
|
57
|
// else if (key.equals("SAM")){return Rank.SAMMELART();}
|
58
|
// else if (key.equals("MOD")){return Rank.MODIFICATIO();}
|
59
|
// else if (key.equals("KMB")){return Rank.COMBINATION();}
|
60
|
// else if (key.equals("SPI")){return Rank.SUBSPECIESPRINCIPES();}
|
61
|
else if (key.equals("GRO") || key.equals("GRU")){return Rank.SPECIESGROUP();}
|
62
|
else if (key.equals("?")){return Rank.UNKNOWN_RANK();}
|
63
|
return null;
|
64
|
}
|
65
|
|
66
|
@Override
|
67
|
public NomenclaturalStatusType getNomenclaturalStatusByKey(String key) throws UndefinedTransformerMethodException {
|
68
|
if (key == null){return null;}
|
69
|
key = key.trim();
|
70
|
if (key.equals("nom. cons.")){return NomenclaturalStatusType.CONSERVED();}
|
71
|
else if (key.equals("nom. illeg.")){return NomenclaturalStatusType.ILLEGITIMATE();}
|
72
|
else if (key.equals("nom. inval.")){return NomenclaturalStatusType.INVALID();}
|
73
|
else if (key.equals("nom. inval. (sine typus)")){return NomenclaturalStatusType.INVALID();}
|
74
|
else if (key.equals("nom. inval. (sine descr.)")){return NomenclaturalStatusType.INVALID();}
|
75
|
else if (key.equals("nom. inval. (sine descr. lat.)")){return NomenclaturalStatusType.INVALID();}
|
76
|
else if (key.equals("nom. inval. (sine basion.)")){return NomenclaturalStatusType.INVALID();}
|
77
|
else if (key.equals("nom. inval. (nom. non accept.)")){return NomenclaturalStatusType.INVALID();}
|
78
|
else if (key.equals("nom. ambig.")){return NomenclaturalStatusType.AMBIGUOUS();}
|
79
|
else if (key.equals("nom. nud.")){return NomenclaturalStatusType.NUDUM();}
|
80
|
else if (key.equals("nom. dub.")){return NomenclaturalStatusType.DOUBTFUL();}
|
81
|
else if (key.equals("nom. rejic.")){return NomenclaturalStatusType.REJECTED();}
|
82
|
else if (key.equals("nom. rejic. prop.")){return NomenclaturalStatusType.REJECTED_PROP();}
|
83
|
else if (key.equals("nom. utique rejic.")){return NomenclaturalStatusType.UTIQUE_REJECTED();}
|
84
|
else if (key.equals("nom. utique rejic. pro.")){return NomenclaturalStatusType.UTIQUE_REJECTED_PROP();}
|
85
|
else if (key.equals("nom. utique rejic. prop.")){return NomenclaturalStatusType.UTIQUE_REJECTED_PROP();}
|
86
|
else if (key.equals("comb. nov.")){return NomenclaturalStatusType.COMB_NOV();}
|
87
|
else if (key.equals("nom. illeg. (nom. superfl.)")){return NomenclaturalStatusType.SUPERFLUOUS();}
|
88
|
else if (key.equals("nom. inval. (nom. nud.)")){return NomenclaturalStatusType.NUDUM();}
|
89
|
else if (key.equals("nom. nud.")){return NomenclaturalStatusType.NUDUM();}
|
90
|
else if (key.equals("nom. inval. (op. utique oppr.)")){return NomenclaturalStatusType.OPUS_UTIQUE_OPPR();}
|
91
|
else if (key.equals("nom. inval. (nom. prov.)")){return NomenclaturalStatusType.PROVISIONAL();}
|
92
|
return null;
|
93
|
}
|
94
|
|
95
|
public TaxonRelationshipType getTaxonRelationshipTypeByKey(String key) {
|
96
|
if (key == null){return null;}
|
97
|
else {
|
98
|
if (key.equals("=")){return TaxonRelationshipType.CONGRUENT_TO();}
|
99
|
else if (key.equals(">")){return TaxonRelationshipType.INCLUDES();}
|
100
|
else if (key.equals("<")){return TaxonRelationshipType.INCLUDES();}
|
101
|
else if (key.equals("!")){return TaxonRelationshipType.OVERLAPS();}
|
102
|
else if (key.equals("?")){return TaxonRelationshipType.UNCLEAR();}
|
103
|
else if (key.equals("x")){return TaxonRelationshipType.NOT_YET_WORKED_ON();}
|
104
|
}
|
105
|
return null;
|
106
|
}
|
107
|
|
108
|
}
|