Project

General

Profile

Download (2.64 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
	/* (non-Javadoc)
33
	 * @see eu.etaxonomy.cdm.io.common.mapping.InputTransformerBase#getFeatureByKey(java.lang.String)
34
	 */
35
	@Override
36
	public Feature getFeatureByKey(String key) throws UndefinedTransformerMethodException {
37
		if (key == null){
38
			return null;
39
		}else if (key.equalsIgnoreCase("ecology")){
40
			return Feature.ECOLOGY();
41
		}else if (key.equalsIgnoreCase("general_description")){
42
			return Feature.DESCRIPTION();
43
		}else if (key.equalsIgnoreCase("diagnostic_description")){
44
			return Feature.DIAGNOSIS();
45
		}else if (key.equalsIgnoreCase("conservation_status")){
46
			return Feature.CONSERVATION();
47
		}else if (key.equalsIgnoreCase("associations")){
48
			return Feature.INDIVIDUALS_ASSOCIATION();   //correct ?
49
		}else if (key.equalsIgnoreCase("distribution")){
50
			return Feature.DISTRIBUTION();
51
		}else if (key.equalsIgnoreCase("habitat")){
52
			return Feature.HABITAT();
53
		}else if (key.equalsIgnoreCase("uses")){
54
			return Feature.USES();
55
		}
56

    
57

    
58

    
59

    
60
		return null;
61
	}
62

    
63
	@Override
64
	public UUID getFeatureUuid(String key) throws UndefinedTransformerMethodException {
65
		if (key == null){
66
			return null;
67
		}else if (key.equalsIgnoreCase("biology")){
68
			return uuidFeatureBiology;
69
		}
70

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

    
98

    
99
		return null;
100
	}
101

    
102

    
103

    
104

    
105

    
106

    
107
}
(12-12/37)