Project

General

Profile

Download (2.52 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 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

    
10
package eu.etaxonomy.cdm.io.dwca.in;
11

    
12
import java.util.UUID;
13

    
14
import org.apache.log4j.Logger;
15

    
16
import eu.etaxonomy.cdm.io.common.mapping.InputTransformerBase;
17
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException;
18
import eu.etaxonomy.cdm.model.description.Feature;
19

    
20
/**
21
 * @author a.mueller
22
 * @created 05.05.2011
23
 */
24
public final class DwcaImportTransformer extends InputTransformerBase {
25
    private static final long serialVersionUID = 3204045957159056826L;
26

    
27
    @SuppressWarnings("unused")
28
	private static final Logger logger = Logger.getLogger(DwcaImportTransformer.class);
29

    
30
	private static final UUID uuidFeatureBiology = UUID.fromString("daf92173-a262-49f1-9a45-923941d9c557");
31

    
32

    
33
	@Override
34
	public Feature getFeatureByKey(String key) throws UndefinedTransformerMethodException {
35
		if (key == null){
36
			return null;
37
		}else if (key.equalsIgnoreCase("ecology")){
38
			return Feature.ECOLOGY();
39
		}else if (key.equalsIgnoreCase("general_description")){
40
			return Feature.DESCRIPTION();
41
		}else if (key.equalsIgnoreCase("diagnostic_description")){
42
			return Feature.DIAGNOSIS();
43
		}else if (key.equalsIgnoreCase("conservation_status")){
44
			return Feature.CONSERVATION();
45
		}else if (key.equalsIgnoreCase("associations")){
46
			return Feature.INDIVIDUALS_ASSOCIATION();   //correct ?
47
		}else if (key.equalsIgnoreCase("distribution")){
48
			return Feature.DISTRIBUTION_GENERAL();
49
		}else if (key.equalsIgnoreCase("habitat")){
50
			return Feature.HABITAT();
51
		}else if (key.equalsIgnoreCase("uses")){
52
			return Feature.USES();
53
		}
54

    
55
		return null;
56
	}
57

    
58
	@Override
59
	public UUID getFeatureUuid(String key) throws UndefinedTransformerMethodException {
60
		if (key == null){
61
			return null;
62
		}else if (key.equalsIgnoreCase("biology")){
63
			return uuidFeatureBiology;
64
		}
65

    
66
		//TODO from eMonocots scratchpad
67
//		morphology
68
//		behavious
69
//		diseases
70
//		dispersal
71
//		legislation
72
//		management
73
//		threats
74
//		cyclicity
75
//		management
76
//
77
//		evolution
78
//		genetics
79
//		growth
80
//		life_cycle
81
//		life_expectancy
82
//		look_alikes
83
//		migration
84
//		molecular_biology
85
//		physiology
86
//		population_biology
87
//		reproduction
88
//		risk_statement
89
//		size
90
//		taxon_biology
91
//		trophic_strategy
92

    
93

    
94
		return null;
95
	}
96

    
97

    
98
}
(12-12/37)