Revision 7d882578
Added by Andreas Müller about 7 years ago
app-import/src/main/java/eu/etaxonomy/cdm/io/wp6/CommonNameRow.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2009 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 |
*/ |
... | ... | |
19 | 19 |
import org.apache.commons.lang.StringUtils; |
20 | 20 |
import org.apache.log4j.Logger; |
21 | 21 |
|
22 |
import eu.etaxonomy.cdm.model.name.BotanicalName; |
|
22 |
import eu.etaxonomy.cdm.model.name.IBotanicalName;
|
|
23 | 23 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode; |
24 | 24 |
import eu.etaxonomy.cdm.strategy.parser.INonViralNameParser; |
25 | 25 |
import eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl; |
... | ... | |
37 | 37 |
private String reference; |
38 | 38 |
private String area; |
39 | 39 |
private String nameUsedInSource; |
40 |
|
|
40 |
|
|
41 | 41 |
private Map<String, List<String>> commonNames = new HashMap<String, List<String>>(); |
42 |
|
|
43 |
|
|
42 |
|
|
43 |
|
|
44 | 44 |
public CommonNameRow() { |
45 | 45 |
this.species = ""; |
46 | 46 |
this.reference = ""; |
47 | 47 |
this.area = ""; |
48 | 48 |
commonNames = new HashMap<String, List<String>>(); |
49 | 49 |
} |
50 |
|
|
51 |
// **************************** GETTER / SETTER *********************************/
|
|
52 |
|
|
50 |
|
|
51 |
// **************************** GETTER / SETTER *********************************/ |
|
52 |
|
|
53 | 53 |
public void setCommonNames(String commonNamesString){ |
54 | 54 |
commonNamesString = makeNameUsedInSource(commonNamesString); |
55 | 55 |
String[] split = commonNamesString.split(";"); |
... | ... | |
87 | 87 |
} |
88 | 88 |
} |
89 | 89 |
} |
90 |
|
|
90 |
|
|
91 | 91 |
private String makeNameUsedInSource(String commonNamesString) { |
92 | 92 |
String[] split = commonNamesString.split(":"); |
93 | 93 |
if (split.length > 1){ |
... | ... | |
105 | 105 |
public Map<String, List<String>> getCommonNames() { |
106 | 106 |
return commonNames; |
107 | 107 |
} |
108 |
|
|
108 |
|
|
109 | 109 |
public void parseSpecies(String species){ |
110 |
INonViralNameParser parser = NonViralNameParserImpl.NewInstance(); |
|
111 |
BotanicalName name = (BotanicalName)parser.parseFullName(species, NomenclaturalCode.ICNAFP, null);
|
|
110 |
INonViralNameParser<?> parser = NonViralNameParserImpl.NewInstance();
|
|
111 |
IBotanicalName name = (IBotanicalName)parser.parseFullName(species, NomenclaturalCode.ICNAFP, null);
|
|
112 | 112 |
if (name.isProtectedTitleCache()){ |
113 | 113 |
logger.warn("Name could not be parsed: " + species); |
114 | 114 |
} |
... | ... | |
118 | 118 |
public String getSpecies() { |
119 | 119 |
return species; |
120 | 120 |
} |
121 |
|
|
121 |
|
|
122 | 122 |
public void setSpecies(String species) { |
123 | 123 |
this.species = species; |
124 | 124 |
} |
... | ... | |
138 | 138 |
public void setArea(String area) { |
139 | 139 |
this.area = area; |
140 | 140 |
} |
141 |
|
|
141 |
|
|
142 | 142 |
public String getArea() { |
143 | 143 |
return area; |
144 | 144 |
} |
... | ... | |
152 | 152 |
} |
153 | 153 |
|
154 | 154 |
|
155 |
|
|
155 |
|
|
156 | 156 |
} |
Also available in: Unified diff
ref #6362, ref #6365 remove occurrences of NonViralName, BotanicalName and ZoologicalName in cdmlib-app