@Test public final void createTaxon() throws NodeFactoryException { Taxon taxon1 = new TaxonImpl("bla bla", null); taxon1.setPath(null); TaxonNode taxon = taxonService.getOrCreateTaxon(taxon1); assertThat(taxon, is(notNullValue())); assertEquals("bla bla", taxon.getName()); }
@Override public TaxonNode getOrCreateTaxon(Taxon taxon) throws NodeFactoryException { TaxonNode taxonNode = findTaxon(taxon); if (taxonNode == null) { taxonNode = TaxonUtil.isResolved(taxon) ? createAndIndexTaxon(taxon, taxon) : addNoMatchTaxon(taxon); } return taxonNode == null ? createAndIndexTaxon(taxon, taxon) : taxonNode; }
NonResolvingTaxonIndex implements TaxonIndex { @Override public TaxonNode getOrCreateTaxon(Taxon taxon) throws NodeFactoryException { TaxonNode taxonNode = findTaxon(taxon); if (taxonNode == null) { taxonNode = TaxonUtil.isResolved(taxon) ? createAndIndexTaxon(taxon, taxon) : addNoMatchTaxon(taxon); } return taxonNode == null ? createAndIndexTaxon(taxon, taxon) : taxonNode; } }
NonResolvingTaxonIndex implements TaxonIndex { @Override public TaxonNode getOrCreateTaxon(Taxon taxon) throws NodeFactoryException { TaxonNode taxonNode = findTaxon(taxon); if (taxonNode == null) { taxonNode = TaxonUtil.isResolved(taxon) ? createAndIndexTaxon(taxon, taxon) : addNoMatchTaxon(taxon); } return taxonNode == null ? createAndIndexTaxon(taxon, taxon) : taxonNode; } NonResolvingTaxonIndex(GraphDatabaseService graphDbService); }
NonResolvingTaxonIndex implements TaxonIndex { @Override public TaxonNode getOrCreateTaxon(Taxon taxon) throws NodeFactoryException { TaxonNode taxonNode = findTaxon(taxon); if (taxonNode == null) { taxonNode = TaxonUtil.isResolved(taxon) ? createAndIndexTaxon(taxon, taxon) : addNoMatchTaxon(taxon); } return taxonNode == null ? createAndIndexTaxon(taxon, taxon) : taxonNode; } NonResolvingTaxonIndex(GraphDatabaseService graphDbService); @Override TaxonNode getOrCreateTaxon(Taxon taxon); @Override TaxonNode findTaxonById(String externalId); @Override TaxonNode findTaxonByName(String name); IndexHits<Node> findCloseMatchesForTaxonName(String taxonName); }
NonResolvingTaxonIndex implements TaxonIndex { @Override public TaxonNode getOrCreateTaxon(Taxon taxon) throws NodeFactoryException { TaxonNode taxonNode = findTaxon(taxon); if (taxonNode == null) { taxonNode = TaxonUtil.isResolved(taxon) ? createAndIndexTaxon(taxon, taxon) : addNoMatchTaxon(taxon); } return taxonNode == null ? createAndIndexTaxon(taxon, taxon) : taxonNode; } NonResolvingTaxonIndex(GraphDatabaseService graphDbService); @Override TaxonNode getOrCreateTaxon(Taxon taxon); @Override TaxonNode findTaxonById(String externalId); @Override TaxonNode findTaxonByName(String name); IndexHits<Node> findCloseMatchesForTaxonName(String taxonName);  }