Revision 6b381b7d
Added by Andreas Müller almost 7 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/specimen/SpecimenImportBase.java | ||
---|---|---|
45 | 45 |
import eu.etaxonomy.cdm.model.description.IndividualsAssociation; |
46 | 46 |
import eu.etaxonomy.cdm.model.description.TaxonDescription; |
47 | 47 |
import eu.etaxonomy.cdm.model.name.INonViralName; |
48 |
import eu.etaxonomy.cdm.model.name.ITaxonNameBase; |
|
49 | 48 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode; |
50 | 49 |
import eu.etaxonomy.cdm.model.name.Rank; |
51 | 50 |
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation; |
... | ... | |
103 | 102 |
|
104 | 103 |
//check atomised name data for rank |
105 | 104 |
//new name will be created |
106 |
ITaxonNameBase atomisedTaxonName = null;
|
|
105 |
TaxonName atomisedTaxonName = null;
|
|
107 | 106 |
if (rank==null && unitIndexInAbcdFile>=0 && ((state.getDataHolder().getAtomisedIdentificationList() != null && !state.getDataHolder().getAtomisedIdentificationList().isEmpty())|| state.getDataHolder().getAtomisedIdentificationList().size() > 0)) { |
108 | 107 |
atomisedTaxonName = setTaxonNameByType(state.getDataHolder().getAtomisedIdentificationList().get(unitIndexInAbcdFile), scientificName, state); |
109 | 108 |
if(atomisedTaxonName!=null){ |
... | ... | |
111 | 110 |
} |
112 | 111 |
} |
113 | 112 |
if(config.isReuseExistingTaxaWhenPossible()){ |
114 |
ITaxonNameBase parsedName = atomisedTaxonName;
|
|
113 |
TaxonName parsedName = atomisedTaxonName;
|
|
115 | 114 |
if(parsedName==null){ |
116 | 115 |
|
117 | 116 |
parsedName = parseScientificName(scientificName, state, state.getReport(), rank); |
... | ... | |
150 | 149 |
} |
151 | 150 |
|
152 | 151 |
if(taxonName==null && atomisedTaxonName!=null){ |
153 |
taxonName = (TaxonName) atomisedTaxonName;
|
|
152 |
taxonName = atomisedTaxonName; |
|
154 | 153 |
state.getReport().addName(taxonName); |
155 | 154 |
logger.info("Created new taxon name "+taxonName); |
156 | 155 |
if(taxonName.hasProblem()){ |
... | ... | |
256 | 255 |
* @return a parsed name |
257 | 256 |
*/ |
258 | 257 |
|
259 |
protected ITaxonNameBase parseScientificName(String scientificName, STATE state, SpecimenImportReport report, Rank rank) {
|
|
258 |
protected TaxonName parseScientificName(String scientificName, STATE state, SpecimenImportReport report, Rank rank) {
|
|
260 | 259 |
|
261 | 260 |
NonViralNameParserImpl nvnpi = NonViralNameParserImpl.NewInstance(); |
262 |
ITaxonNameBase taxonName = null;
|
|
261 |
TaxonName taxonName = null;
|
|
263 | 262 |
boolean problem = false; |
264 | 263 |
|
265 | 264 |
if (logger.isDebugEnabled()){ |
... | ... | |
267 | 266 |
} |
268 | 267 |
|
269 | 268 |
if (state.getDataHolder().getNomenclatureCode().toString().equals("Zoological") || state.getDataHolder().getNomenclatureCode().toString().contains("ICZN")) { |
270 |
taxonName = nvnpi.parseFullName(scientificName, NomenclaturalCode.ICZN, rank); |
|
269 |
taxonName = (TaxonName)nvnpi.parseFullName(scientificName, NomenclaturalCode.ICZN, rank);
|
|
271 | 270 |
if (taxonName.hasProblem()) { |
272 | 271 |
problem = true; |
273 | 272 |
} |
274 | 273 |
} |
275 | 274 |
else if (state.getDataHolder().getNomenclatureCode().toString().equals("Botanical") || state.getDataHolder().getNomenclatureCode().toString().contains("ICBN")) { |
276 |
taxonName = nvnpi.parseFullName(scientificName, NomenclaturalCode.ICNAFP, rank); |
|
275 |
taxonName = (TaxonName)nvnpi.parseFullName(scientificName, NomenclaturalCode.ICNAFP, rank);
|
|
277 | 276 |
if (taxonName.hasProblem()) { |
278 | 277 |
problem = true; |
279 | 278 |
} |
280 | 279 |
} |
281 | 280 |
else if (state.getDataHolder().getNomenclatureCode().toString().equals("Bacterial") || state.getDataHolder().getNomenclatureCode().toString().contains("ICBN")) { |
282 |
taxonName = nvnpi.parseFullName(scientificName, NomenclaturalCode.ICNB, rank); |
|
281 |
taxonName = (TaxonName)nvnpi.parseFullName(scientificName, NomenclaturalCode.ICNB, rank);
|
|
283 | 282 |
if (taxonName.hasProblem()) { |
284 | 283 |
problem = true; |
285 | 284 |
} |
286 | 285 |
} |
287 | 286 |
else if (state.getDataHolder().getNomenclatureCode().toString().equals("Cultivar") || state.getDataHolder().getNomenclatureCode().toString().contains("ICNCP")) { |
288 |
taxonName = nvnpi.parseFullName(scientificName, NomenclaturalCode.ICNCP, rank); |
|
287 |
taxonName = (TaxonName)nvnpi.parseFullName(scientificName, NomenclaturalCode.ICNCP, rank);
|
|
289 | 288 |
if (taxonName.hasProblem()) { |
290 | 289 |
problem = true; |
291 | 290 |
} |
... | ... | |
379 | 378 |
} |
380 | 379 |
} |
381 | 380 |
else if (state.getDataHolder().getNomenclatureCode().equals("Botanical") || state.getDataHolder().getNomenclatureCode().equals(NomenclaturalCode.ICNAFP.getUuid())) { |
382 |
TaxonName taxonName = (TaxonName)parseScientificName(fullName, state, state.getReport(), null);
|
|
381 |
TaxonName taxonName = parseScientificName(fullName, state, state.getReport(), null); |
|
383 | 382 |
if (taxonName != null){ |
384 | 383 |
return taxonName; |
385 | 384 |
} |
Also available in: Unified diff
ref #6368 remove some further occurrences of ITaxonNameBase