use of org.openforis.collect.io.exception.ParsingException in project collect by openforis.
the class SpeciesImportProcess method createTaxonSpecies.
protected Taxon createTaxonSpecies(SpeciesLine line) throws ParsingException {
String speciesName;
if (line.getRank() == SPECIES) {
speciesName = line.getCanonicalScientificName();
} else {
speciesName = line.getSpeciesName();
}
if (speciesName == null) {
ParsingError error = new ParsingError(ErrorType.INVALID_VALUE, line.getLineNumber(), SpeciesFileColumn.SCIENTIFIC_NAME.getColumnName(), INVALID_SPECIES_NAME_ERROR_MESSAGE_KEY);
throw new ParsingException(error);
}
Taxon taxonGenus = createTaxonGenus(line);
return createTaxon(line, SPECIES, taxonGenus, speciesName);
}
Aggregations