Revision 79276af0
Added by Andreas Müller over 4 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/indexFungorum/IndexFungorumTransformer.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2007 EDIT |
3 |
* European Distributed Institute of Taxonomy
|
|
3 |
* European Distributed Institute of Taxonomy |
|
4 | 4 |
* http://www.e-taxonomy.eu |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
... | ... | |
15 | 15 |
import eu.etaxonomy.cdm.io.common.TdwgAreaProvider; |
16 | 16 |
import eu.etaxonomy.cdm.io.common.mapping.InputTransformerBase; |
17 | 17 |
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException; |
18 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
|
19 | 18 |
import eu.etaxonomy.cdm.model.location.Country; |
20 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
|
|
19 |
import eu.etaxonomy.cdm.model.location.NamedArea;
|
|
21 | 20 |
import eu.etaxonomy.cdm.model.name.Rank; |
22 | 21 |
|
23 | 22 |
/** |
24 | 23 |
* @author a.mueller |
25 | 24 |
* @since 01.03.2010 |
26 |
* @version 1.0 |
|
27 | 25 |
*/ |
28 | 26 |
public final class IndexFungorumTransformer extends InputTransformerBase { |
29 |
private static final Logger logger = Logger.getLogger(IndexFungorumTransformer.class); |
|
30 |
|
|
31 |
public static final String LSID_PREFIX = "urn:lsid:indexfungorum.org:names:"; |
|
32 | 27 |
|
33 |
public static NomenclaturalCode kingdomId2NomCode(Integer kingdomId){ |
|
34 |
switch (kingdomId){ |
|
35 |
case 1: return null; |
|
36 |
case 2: return NomenclaturalCode.ICZN; //Animalia |
|
37 |
case 3: return NomenclaturalCode.ICNAFP; //Plantae |
|
38 |
case 4: return NomenclaturalCode.ICNAFP; //Fungi |
|
39 |
case 5: return NomenclaturalCode.ICZN ; //Protozoa |
|
40 |
case 6: return NomenclaturalCode.ICNB ; //Bacteria |
|
41 |
case 7: return NomenclaturalCode.ICNAFP; //Chromista |
|
42 |
case 147415: return NomenclaturalCode.ICNB; //Monera |
|
43 |
default: return null; |
|
44 |
|
|
45 |
} |
|
46 |
} |
|
28 |
private static final long serialVersionUID = 7930365658820136180L; |
|
29 |
private static final Logger logger = Logger.getLogger(IndexFungorumTransformer.class); |
|
47 | 30 |
|
31 |
public static final String LSID_PREFIX = "urn:lsid:indexfungorum.org:names:"; |
|
48 | 32 |
|
49 | 33 |
|
50 | 34 |
@Override |
... | ... | |
66 | 50 |
logger.warn("Unhandled rank: " + rankFk); |
67 | 51 |
return null; |
68 | 52 |
} |
69 |
|
|
70 | 53 |
} |
71 | 54 |
|
72 | 55 |
|
73 |
|
|
74 |
/* (non-Javadoc) |
|
75 |
* @see eu.etaxonomy.cdm.io.common.mapping.InputTransformerBase#getNamedAreaByKey(java.lang.String) |
|
76 |
*/ |
|
77 | 56 |
@Override |
78 | 57 |
public NamedArea getNamedAreaByKey(String key) throws UndefinedTransformerMethodException { |
79 | 58 |
if (StringUtils.isBlank(key)){ |
... | ... | |
101 | 80 |
}else if (key.equalsIgnoreCase("SE")){return TdwgAreaProvider.getAreaByTdwgAbbreviation("SWE-OO"); |
102 | 81 |
}else if (key.equalsIgnoreCase("AM")){return TdwgAreaProvider.getAreaByTdwgAbbreviation("TCS-AR"); |
103 | 82 |
}else if (key.equalsIgnoreCase("IL")){return TdwgAreaProvider.getAreaByTdwgAbbreviation("PAL-IS"); |
104 |
|
|
83 |
|
|
105 | 84 |
}else if (key.equalsIgnoreCase("UK")){return Country.UNITEDKINGDOMOFGREATBRITAINANDNORTHERNIRELAND(); |
106 | 85 |
}else if (key.equalsIgnoreCase("DK")){return Country.DENMARKKINGDOMOF(); |
107 | 86 |
}else if (key.equalsIgnoreCase("GR")){return Country.GREECEHELLENICREPUBLIC(); |
... | ... | |
111 | 90 |
}else if (key.equalsIgnoreCase("UA")){return Country.UKRAINE(); |
112 | 91 |
}else if (key.equalsIgnoreCase("GE")){return Country.GEORGIA(); |
113 | 92 |
}else if (key.equalsIgnoreCase("TR")){return Country.TURKEYREPUBLICOF(); |
114 |
|
|
115 |
|
|
93 |
|
|
116 | 94 |
} else { |
117 | 95 |
logger.warn("Area not yet mapped: " + key); |
118 | 96 |
return null; |
Also available in: Unified diff
cleanup