@Ignore @Test public void testAddScientificNames() throws Exception { }
private boolean addScientificNames(Taxon taxon) { Name[] names = getNameElements(); if (names == null) return false; for (Name name : names) { String nametype = val(name.getNametype()); if (nametype == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Missing <nametype> element under <name> element"); return false; } if (!isVernacularName(nametype)) { if (!add(taxon, getScientificName(name))) { return false; } } } if (taxon.getAcceptedName() == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Missing accepted name for taxon"); return false; } return true; }
NsrTaxonTransformer extends AbstractJSONTransformer<Taxon> { private boolean addScientificNames(Taxon taxon) { Name[] names = getNameElements(); if (names == null) return false; for (Name name : names) { String nametype = val(name.getNametype()); if (nametype == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Missing <nametype> element under <name> element"); return false; } if (!isVernacularName(nametype)) { if (!add(taxon, getScientificName(name))) { return false; } } } if (taxon.getAcceptedName() == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Missing accepted name for taxon"); return false; } return true; } }
NsrTaxonTransformer extends AbstractJSONTransformer<Taxon> { private boolean addScientificNames(Taxon taxon) { Name[] names = getNameElements(); if (names == null) return false; for (Name name : names) { String nametype = val(name.getNametype()); if (nametype == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Missing <nametype> element under <name> element"); return false; } if (!isVernacularName(nametype)) { if (!add(taxon, getScientificName(name))) { return false; } } } if (taxon.getAcceptedName() == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Missing accepted name for taxon"); return false; } return true; } NsrTaxonTransformer(ETLStatistics stats); }
NsrTaxonTransformer extends AbstractJSONTransformer<Taxon> { private boolean addScientificNames(Taxon taxon) { Name[] names = getNameElements(); if (names == null) return false; for (Name name : names) { String nametype = val(name.getNametype()); if (nametype == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Missing <nametype> element under <name> element"); return false; } if (!isVernacularName(nametype)) { if (!add(taxon, getScientificName(name))) { return false; } } } if (taxon.getAcceptedName() == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Missing accepted name for taxon"); return false; } return true; } NsrTaxonTransformer(ETLStatistics stats);  }
NsrTaxonTransformer extends AbstractJSONTransformer<Taxon> { private boolean addScientificNames(Taxon taxon) { Name[] names = getNameElements(); if (names == null) return false; for (Name name : names) { String nametype = val(name.getNametype()); if (nametype == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Missing <nametype> element under <name> element"); return false; } if (!isVernacularName(nametype)) { if (!add(taxon, getScientificName(name))) { return false; } } } if (taxon.getAcceptedName() == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Missing accepted name for taxon"); return false; } return true; } NsrTaxonTransformer(ETLStatistics stats);   }