import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
import eu.etaxonomy.cdm.model.name.TypeDesignationStatusBase;
+import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
import eu.etaxonomy.taxeditor.store.CdmStore;
return getCache((HomotypicalGroup) element);
}else if (element instanceof TaxonNode) {
return getCache((TaxonNode) element);
+ }else if (element instanceof DeterminationEvent) {
+ return getCache((DeterminationEvent) element);
}else if (element instanceof Marker) {
Marker marker = (Marker) element;
MarkerType type = marker.getMarkerType();
}
+ private static String getCache(DeterminationEvent detEvent) {
+ //taxon
+ String taxonStr = "no taxon";
+ TaxonNameBase<?,?> taxonName = detEvent.getTaxonName();
+ TaxonBase<?> taxon = detEvent.getTaxon();
+ if (taxonName != null){
+ taxonStr = taxonName.getTitleCache();
+ }else if (taxon != null){
+ taxonStr = taxon.getTitleCache();
+ }
+ //unit
+ String unitStr = "no unit";
+ SpecimenOrObservationBase<?> unit = detEvent.getIdentifiedUnit();
+ if (unit != null){
+ unitStr = unit.getTitleCache();
+ }
+
+ String result = CdmUtils.concat(" determined as ", unitStr, taxonStr);
+
+ return result;
+ }
+
private static String getCache(TaxonNode taxonNode) {
String result = "";
Classification classification = taxonNode.getClassification();
}
result = CdmUtils.concat(": ", result, parentStr);
- return null;
+ return result;
}
private static String getCache(TypeDesignationBase<?> designation) {
toMethod.setAccessible(true);
from = (IdentifiableEntity<?>)fromMethod.invoke(rel);
to = (IdentifiableEntity<?>)toMethod.invoke(rel);
- } catch (NoSuchMethodException e) {
- throw new RuntimeException(e);
- } catch (SecurityException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- } catch (IllegalArgumentException e) {
- throw new RuntimeException(e);
- } catch (InvocationTargetException e) {
+ } catch (NoSuchMethodException | SecurityException | IllegalAccessException
+ | IllegalArgumentException | InvocationTargetException e) {
throw new RuntimeException(e);
}
-
}
String typeLabel = null;
if (type != null){