Project

General

Profile

« Previous | Next » 

Revision 9301ba90

Added by Patrick Plitzner almost 6 years ago

Import unranked taxa #5448

View differences:

app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListGefaesspflanzenImportNames.java
328 328
            RedListUtil.logMessage(id, "No name found!", logger);
329 329
        }
330 330

  
331
        Rank rank = makeRank(id, state, rangString);
331
        Rank rank = makeRank(id, state, rangString, ep3String!=null);
332 332
        NonViralName<?> name = BotanicalName.NewInstance(rank);
333 333

  
334 334
        //ep1 should always be present
......
457 457
        }
458 458
    }
459 459

  
460
    private Rank makeRank(long id, RedListGefaesspflanzenImportState state, String rankStr) {
460
    private Rank makeRank(long id, RedListGefaesspflanzenImportState state, String rankStr, boolean hasSpecificEpithet) {
461 461
        Rank rank = null;
462 462
        try {
463
            rank = state.getTransformer().getRankByKey(rankStr);
463
            if(rankStr.equals("ORA")){
464
                //special handling for ORA because of two possibilities
465
                if(hasSpecificEpithet){
466
                    return Rank.UNRANKED_INFRASPECIFIC();
467
                }
468
                else{
469
                    return Rank.UNRANKED_INFRAGENERIC();
470
                }
471
            }
472
            else{
473
                rank = state.getTransformer().getRankByKey(rankStr);
474
            }
464 475
        } catch (UndefinedTransformerMethodException e) {
465 476
            e.printStackTrace();
466 477
        }

Also available in: Unified diff