Revision d7919b1c
Added by Andreas Müller about 7 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/specimen/SpecimenImportBase.java | ||
---|---|---|
47 | 47 |
import eu.etaxonomy.cdm.model.name.BotanicalName; |
48 | 48 |
import eu.etaxonomy.cdm.model.name.CultivarPlantName; |
49 | 49 |
import eu.etaxonomy.cdm.model.name.INonViralName; |
50 |
import eu.etaxonomy.cdm.model.name.ITaxonNameBase; |
|
50 | 51 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode; |
51 | 52 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
52 | 53 |
import eu.etaxonomy.cdm.model.name.Rank; |
... | ... | |
100 | 101 |
|
101 | 102 |
|
102 | 103 |
protected TaxonNameBase<?, ?> getOrCreateTaxonName(String scientificName, Rank rank, boolean preferredFlag, STATE state, int unitIndexInAbcdFile){ |
103 |
TaxonNameBase<?, ?> taxonName = null;
|
|
104 |
TaxonNameBase<?,?> taxonName = null; |
|
104 | 105 |
SpecimenImportConfiguratorBase<?,?> config = state.getConfig(); |
105 | 106 |
|
106 | 107 |
//check atomised name data for rank |
... | ... | |
115 | 116 |
if(config.isReuseExistingTaxaWhenPossible()){ |
116 | 117 |
TaxonNameBase<?,?> parsedName = atomisedTaxonName; |
117 | 118 |
if(parsedName==null){ |
118 |
parsedName = parseScientificName(scientificName, state, state.getReport()); |
|
119 |
parsedName = (TaxonNameBase<?,?>)parseScientificName(scientificName, state, state.getReport());
|
|
119 | 120 |
} |
120 | 121 |
atomisedTaxonName = parsedName; |
121 | 122 |
if(config.isIgnoreAuthorship() && parsedName!=null && preferredFlag){ |
122 | 123 |
// do not ignore authorship for non-preferred names because they need |
123 | 124 |
// to be created for the determination history |
124 |
String nameCache = parsedName.getNameCache();
|
|
125 |
String nameCache = TaxonNameBase.castAndDeproxy(parsedName).getNameCache();
|
|
125 | 126 |
List<NonViralName> names = getNameService().findNamesByNameCache(nameCache, MatchMode.EXACT, null); |
126 | 127 |
if (!names.isEmpty()){ |
127 | 128 |
return getBestMatchingName(scientificName, new ArrayList<TaxonNameBase>(names), state); |
... | ... | |
220 | 221 |
* @param report the import report |
221 | 222 |
* @return a parsed name |
222 | 223 |
*/ |
223 |
protected TaxonNameBase<?,?> parseScientificName(String scientificName, STATE state, SpecimenImportReport report) {
|
|
224 |
protected ITaxonNameBase parseScientificName(String scientificName, STATE state, SpecimenImportReport report) {
|
|
224 | 225 |
NonViralNameParserImpl nvnpi = NonViralNameParserImpl.NewInstance(); |
225 |
TaxonNameBase<?,?> taxonName = null;
|
|
226 |
ITaxonNameBase taxonName = null;
|
|
226 | 227 |
boolean problem = false; |
227 | 228 |
|
228 | 229 |
if(DEBUG){ |
Also available in: Unified diff
ref #6362, ref #6365 remove occurrence of NonViralName, BotanicalName, ZoologicalName and others