Revision 2d7259ef
Added by Andreas Müller over 4 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/out/PesiExportBase.java | ||
---|---|---|
527 | 527 |
return getAcceptedTaxonForMisappliedName(taxon) != null; |
528 | 528 |
} |
529 | 529 |
|
530 |
/** |
|
531 |
* Checks whether a given taxon is a pro parte or partial synonym. |
|
532 |
* @param taxon The {@link TaxonBase Taxon}. |
|
533 |
* @return <code>true</code> if the the given taxon is a pp or partial synonym |
|
534 |
*/ |
|
535 |
protected static boolean isProParteOrPartialSynonym(TaxonBase<?> taxon) { |
|
536 |
return getAcceptedTaxonForProParteSynonym(taxon) != null; |
|
537 |
} |
|
538 |
|
|
530 | 539 |
/** |
531 | 540 |
* Returns the first accepted taxon for this misapplied name. |
532 | 541 |
* If this misapplied name is not a misapplied name, <code>null</code> is returned. |
533 | 542 |
* @param taxon The {@link TaxonBase Taxon}. |
534 | 543 |
*/ |
535 |
private static Taxon getAcceptedTaxonForMisappliedName(TaxonBase<?> taxon) {
|
|
544 |
protected static Taxon getAcceptedTaxonForMisappliedName(TaxonBase<?> taxon) {
|
|
536 | 545 |
if (! taxon.isInstanceOf(Taxon.class)){ |
537 | 546 |
return null; |
538 | 547 |
} |
539 | 548 |
Set<TaxonRelationship> taxonRelations = CdmBase.deproxy(taxon, Taxon.class).getRelationsFromThisTaxon(); |
540 | 549 |
for (TaxonRelationship taxonRelationship : taxonRelations) { |
541 | 550 |
TaxonRelationshipType taxonRelationshipType = taxonRelationship.getType(); |
542 |
if (taxonRelationshipType.equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR())) {
|
|
551 |
if (taxonRelationshipType.isAnyMisappliedName()) {
|
|
543 | 552 |
return taxonRelationship.getToTaxon(); |
544 | 553 |
} |
545 | 554 |
} |
546 | 555 |
return null; |
547 | 556 |
} |
548 | 557 |
|
558 |
protected static Taxon getAcceptedTaxonForProParteSynonym(TaxonBase<?> taxon) { |
|
559 |
if (! taxon.isInstanceOf(Taxon.class)){ |
|
560 |
return null; |
|
561 |
} |
|
562 |
Set<TaxonRelationship> taxonRelations = CdmBase.deproxy(taxon, Taxon.class).getRelationsFromThisTaxon(); |
|
563 |
for (TaxonRelationship taxonRelationship : taxonRelations) { |
|
564 |
TaxonRelationshipType taxonRelationshipType = taxonRelationship.getType(); |
|
565 |
if (taxonRelationshipType.isAnySynonym()) { |
|
566 |
return taxonRelationship.getToTaxon(); |
|
567 |
} |
|
568 |
} |
|
569 |
return null; |
|
570 |
} |
|
571 |
|
|
549 | 572 |
protected List<AnnotationType> getLastActionAnnotationTypes() { |
550 | 573 |
Set<UUID> uuidSet = new HashSet<>(); |
551 | 574 |
uuidSet.add(DbLastActionMapper.uuidAnnotationTypeLastActionDate); |
Also available in: Unified diff
ref #2717 some updates to PESI export