Revert "Revert "ref #6369 Add interfaces for TaxonNameBase and NonViralName""
authorAndreas Kohlbecker <a.kohlbecker@bgbm.org>
Wed, 25 Jan 2017 11:54:44 +0000 (12:54 +0100)
committerAndreas Kohlbecker <a.kohlbecker@bgbm.org>
Wed, 25 Jan 2017 11:54:44 +0000 (12:54 +0100)
This reverts commit 949c09b142f2806539e3fb399bef980d3e17e293.

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/INonViralName.java [new file with mode: 0644]
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/ITaxonNameBase.java [new file with mode: 0644]
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/NonViralName.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/TaxonNameBase.java

diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/INonViralName.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/INonViralName.java
new file mode 100644 (file)
index 0000000..9b1fc98
--- /dev/null
@@ -0,0 +1,503 @@
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.model.name;
+
+import java.util.List;
+import java.util.Set;
+
+import javax.persistence.Transient;
+
+import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
+
+/**
+ * @author a.mueller
+ * @date 21.01.2017
+ *
+ */
+public interface INonViralName<T extends NonViralName> extends ITaxonNameBase<T>{
+
+    /**
+     * Creates a new {@link HybridRelationship#HybridRelationship(TaxonNameBase, TaxonNameBase, HybridRelationshipType, String) hybrid relationship}
+     * to <i>this</i> non viral name. A HybridRelationship may be of type
+     * "is first/second parent" or "is male/female parent". By invoking this
+     * method <i>this</i> non viral name becomes a parent of the hybrid child
+     * non viral name.
+     *
+     * @param childName       the non viral name of the child for this new hybrid name relationship
+     * @param type            the type of this new name relationship
+     * @param ruleConsidered  the string which specifies the rule on which this name relationship is based
+     * @return
+     * @see                   #addHybridParent(TaxonNameBase, HybridRelationshipType,String )
+     * @see                   #getRelationsToThisName()
+     * @see                   #getNameRelations()
+     * @see                   #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
+     * @see                   #addNameRelationship(NameRelationship)
+     */
+    public HybridRelationship addHybridChild(NonViralName childName, HybridRelationshipType type, String ruleConsidered);
+
+    /**
+     * Creates a new {@link HybridRelationship#HybridRelationship(TaxonNameBase, TaxonNameBase, HybridRelationshipType, String) hybrid relationship}
+     * to <i>this</i> non viral name. A HybridRelationship may be of type
+     * "is first/second parent" or "is male/female parent". By invoking this
+     * method <i>this</i> non viral name becomes a hybrid child of the parent
+     * non viral name.
+     *
+     * @param parentName      the non viral name of the parent for this new hybrid name relationship
+     * @param type            the type of this new name relationship
+     * @param ruleConsidered  the string which specifies the rule on which this name relationship is based
+     * @return
+     * @see                   #addHybridChild(TaxonNameBase, HybridRelationshipType,String )
+     * @see                   #getRelationsToThisName()
+     * @see                   #getNameRelations()
+     * @see                   #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
+     * @see                   #addNameRelationship(NameRelationship)
+     */
+    public HybridRelationship addHybridParent(NonViralName parentName, HybridRelationshipType type, String ruleConsidered);
+
+    /**
+     * Shortcut. Returns the basionym authors title cache. Returns null if no basionym author exists.
+     * @return
+     */
+    public String computeBasionymAuthorNomenclaturalTitle() ;
+
+    /**
+     * Shortcut. Returns the combination authors title cache. Returns null if no combination author exists.
+     * @return
+     */
+    public String computeCombinationAuthorNomenclaturalTitle();
+
+    /**
+     * Shortcut. Returns the ex-basionym authors title cache. Returns null if no exbasionym author exists.
+     * @return
+     */
+    public String computeExBasionymAuthorNomenclaturalTitle();
+
+    /**
+     * Shortcut. Returns the ex-combination authors title cache. Returns null if no ex-combination author exists.
+     * @return
+     */
+    public String computeExCombinationAuthorNomenclaturalTitle();
+
+    /**
+     * Generates and returns a concatenated and formatted author teams string
+     * including basionym and combination authors of <i>this</i> non viral taxon name
+     * according to the strategy defined in
+     * {@link eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy#getAuthorshipCache(NonViralName) INonViralNameCacheStrategy}.
+     *
+     * @return  the string with the concatenated and formated author teams for <i>this</i> non viral taxon name
+     * @see     eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy#getAuthorshipCache(NonViralName)
+     */
+    public String generateAuthorship();
+
+
+    /**
+     * Returns the concatenated and formatted author teams string including
+     * basionym and combination authors of <i>this</i> non viral taxon name.
+     * If the protectedAuthorshipCache flag is set this method returns the
+     * string stored in the the authorshipCache attribute, otherwise it
+     * generates the complete authorship string, returns it and stores it in
+     * the authorshipCache attribute.
+     *
+     * @return  the string with the concatenated and formated author teams for <i>this</i> non viral taxon name
+     * @see     #generateAuthorship()
+     */
+    @Transient
+    public String getAuthorshipCache();
+
+    /**
+     * Returns the {@link eu.etaxonomy.cdm.model.agent.TeamOrPersonBase author (team)} that published the original combination
+     * on which <i>this</i> non viral taxon name is nomenclaturally based. Such an
+     * author (team) can only exist if <i>this</i> non viral taxon name is a new
+     * combination due to a taxonomical revision.
+     *
+     * @return  the nomenclatural basionym author (team) of <i>this</i> non viral taxon name
+     * @see     #getCombinationAuthorship()
+     * @see     eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor
+     * @see     eu.etaxonomy.cdm.model.agent.TeamOrPersonBase#getNomenclaturalTitle()
+     */
+    public TeamOrPersonBase<?> getBasionymAuthorship();
+
+    /**
+     * Returns the {@link eu.etaxonomy.cdm.model.agent.TeamOrPersonBase author (team)} that published <i>this</i> non viral
+     * taxon name.
+     *
+     * @return  the nomenclatural author (team) of <i>this</i> non viral taxon name
+     * @see     eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor
+     * @see     eu.etaxonomy.cdm.model.agent.TeamOrPersonBase#getNomenclaturalTitle()
+     */
+    public TeamOrPersonBase<?> getCombinationAuthorship();
+
+
+    /**
+     * Returns the {@link eu.etaxonomy.cdm.model.agent.TeamOrPersonBase author (team)} that contributed to
+     * the publication of the original combination <i>this</i> non viral taxon name is
+     * based on. This should have been generally stated by
+     * the {@link #getBasionymAuthorship() basionym author (team)} itself.
+     * The presence of a basionym author (team) of <i>this</i> non viral taxon name is a
+     * condition for the existence of an ex basionym author (team)
+     * for <i>this</i> same name.
+     *
+     * @return  the nomenclatural ex basionym author (team) of <i>this</i> non viral taxon name
+     * @see     #getBasionymAuthorship()
+     * @see     #getExCombinationAuthorship()
+     * @see     #getCombinationAuthorship()
+     * @see     eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor
+     * @see     eu.etaxonomy.cdm.model.agent.TeamOrPersonBase#getNomenclaturalTitle()
+     */
+    public TeamOrPersonBase<?> getExBasionymAuthorship();
+
+    /**
+     * Returns the {@link eu.etaxonomy.cdm.model.agent.TeamOrPersonBase author (team)} that contributed to
+     * the publication of <i>this</i> non viral taxon name as generally stated by
+     * the {@link #getCombinationAuthorship() combination author (team)} itself.<BR>
+     * An ex-author(-team) is an author(-team) to whom a taxon name was ascribed
+     * although it is not the author(-team) of a valid publication (for instance
+     * without the validating description or diagnosis in case of a name for a
+     * new taxon). The name of this ascribed authorship, followed by "ex", may
+     * be inserted before the name(s) of the publishing author(s) of the validly
+     * published name:<BR>
+     * <i>Lilium tianschanicum</i> was described by Grubov (1977) as a new species and
+     * its name was ascribed to Ivanova; since there is no indication that
+     * Ivanova provided the validating description, the name may be cited as
+     * <i>Lilium tianschanicum</i> N. A. Ivanova ex Grubov or <i>Lilium tianschanicum</i> Grubov.
+     * <P>
+     * The presence of an author (team) of <i>this</i> non viral taxon name is a
+     * condition for the existence of an ex author (team) for <i>this</i> same name.
+     *
+     * @return  the nomenclatural ex author (team) of <i>this</i> non viral taxon name
+     * @see     #getCombinationAuthorship()
+     * @see     eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor
+     * @see     eu.etaxonomy.cdm.model.agent.TeamOrPersonBase#getNomenclaturalTitle()
+     */
+    public TeamOrPersonBase<?> getExCombinationAuthorship();
+
+    /**
+     * Returns either the scientific name string (without authorship) for <i>this</i>
+     * non viral taxon name if its rank is genus or higher (monomial) or the string for
+     * the genus part of it if its {@link Rank rank} is lower than genus (bi- or trinomial).
+     * Genus or uninomial strings begin with an upper case letter.
+     *
+     * @return  the string containing the suprageneric name, the genus name or the genus part of <i>this</i> non viral taxon name
+     * @see     #getNameCache()
+     */
+    public String getGenusOrUninomial();
+
+    /**
+     * Returns the set of all {@link HybridRelationship hybrid relationships}
+     * in which <i>this</i> taxon name is involved as a {@link common.RelationshipBase#getRelatedTo() child}.
+     *
+     * @see    #getHybridRelationships()
+     * @see    #getParentRelationships()
+     * @see    HybridRelationshipType
+     */
+    public Set<HybridRelationship> getHybridChildRelations();
+
+    /**
+     * Returns the set of all {@link HybridRelationship hybrid relationships}
+     * in which <i>this</i> taxon name is involved as a {@link common.RelationshipBase#getRelatedFrom() parent}.
+     *
+     * @see    #getHybridRelationships()
+     * @see    #getChildRelationships()
+     * @see    HybridRelationshipType
+     */
+    public Set<HybridRelationship> getHybridParentRelations();
+
+    /**
+     * Returns the genus subdivision epithet string (infrageneric part) for
+     * <i>this</i> non viral taxon name if its {@link Rank rank} is infrageneric (lower than genus and
+     * higher than species aggregate: binomial). Genus subdivision epithet
+     * strings begin with an upper case letter.
+     *
+     * @return  the string containing the infrageneric part of <i>this</i> non viral taxon name
+     * @see     #getNameCache()
+     */
+    public String getInfraGenericEpithet();
+
+    /**
+     * Returns the species epithet string for <i>this</i> non viral taxon name if its {@link Rank rank} is
+     * species aggregate or lower (bi- or trinomial). Species epithet strings
+     * begin with a lower case letter.
+     *
+     * @return  the string containing the species epithet of <i>this</i> non viral taxon name
+     * @see     #getNameCache()
+     */
+    public String getSpecificEpithet();
+
+    /**
+     * Returns the species subdivision epithet string (infraspecific part) for
+     * <i>this</i> non viral taxon name if its {@link Rank rank} is infraspecific
+     * (lower than species: trinomial). Species subdivision epithet strings
+     * begin with a lower case letter.
+     *
+     * @return  the string containing the infraspecific part of <i>this</i> non viral taxon name
+     * @see     #getNameCache()
+     */
+    public String getInfraSpecificEpithet();
+
+
+    /**
+     * Defines the last part of the name.
+     * This is for infraspecific taxa, the infraspecific epithet,
+     * for species the specific epithet, for infageneric taxa the infrageneric epithet
+     * else the genusOrUninomial.
+     * However, the result does not depend on the rank (which may be not correctly set
+     * in case of dirty data) but returns the first name part which is not blank
+     * considering the above order.
+     * @return the first not blank name part in reverse order
+     */
+    public String getLastNamePart();
+
+    /**
+     * Returns or generates the nameCache (scientific name
+     * without author strings and year) string for <i>this</i> non viral taxon name. If the
+     * {@link #isProtectedNameCache() protectedNameCache} flag is not set (False)
+     * the string will be generated according to a defined strategy,
+     * otherwise the value of the actual nameCache string will be returned.
+     *
+     * @return  the string which identifies <i>this</i> non viral taxon name (without authors or year)
+     * @see     #generateNameCache()
+     */
+    @Transient
+    public String getNameCache() ;
+
+    /**
+     * Returns the hybrid child relationships ordered by relationship type, or if equal
+     * by title cache of the related names.
+     * @see #getHybridParentRelations()
+     */
+    @Transient
+    public List<HybridRelationship> getOrderedChildRelationships();
+
+    /**
+     * Tests if the given name has any authors.
+     * @return false if no author ((ex)combination or (ex)basionym) exists, true otherwise
+     */
+    public boolean hasAuthors();
+
+    /**
+     * Needs to be implemented by those classes that handle autonyms (e.g. botanical names).
+     **/
+   @Transient
+   public boolean isAutonym();
+
+
+   /**
+    * Returns the boolean value of the flag indicating whether the name of <i>this</i>
+    * botanical taxon name is a hybrid formula (true) or not (false). A hybrid
+    * named by a hybrid formula (composed with its parent names by placing the
+    * multiplication sign between them) does not have an own published name
+    * and therefore has neither an {@link NonViralName#getAuthorshipCache() autorship}
+    * nor other name components. If this flag is set no other hybrid flags may
+    * be set.
+    *
+    * @return  the boolean value of the isHybridFormula flag
+    * @see     #isMonomHybrid()
+    * @see     #isBinomHybrid()
+    * @see     #isTrinomHybrid()
+    */
+   public boolean isHybridFormula();
+
+   /**
+    * Returns the boolean value of the flag indicating whether <i>this</i> botanical
+    * taxon name is the name of an intergeneric hybrid (true) or not (false).
+    * In this case the multiplication sign is placed before the scientific
+    * name. If this flag is set no other hybrid flags may be set.
+    *
+    * @return  the boolean value of the isMonomHybrid flag
+    * @see     #isHybridFormula()
+    * @see     #isBinomHybrid()
+    * @see     #isTrinomHybrid()
+    */
+   public boolean isMonomHybrid();
+
+   /**
+    * Returns the boolean value of the flag indicating whether <i>this</i> botanical
+    * taxon name is the name of an interspecific hybrid (true) or not (false).
+    * In this case the multiplication sign is placed before the species
+    * epithet. If this flag is set no other hybrid flags may be set.
+    *
+    * @return  the boolean value of the isBinomHybrid flag
+    * @see     #isHybridFormula()
+    * @see     #isMonomHybrid()
+    * @see     #isTrinomHybrid()
+    */
+   public boolean isBinomHybrid();
+
+   /**
+    * Returns the boolean value of the flag indicating whether <i>this</i> botanical
+    * taxon name is the name of an infraspecific hybrid (true) or not (false).
+    * In this case the term "notho-" (optionally abbreviated "n-") is used as
+    * a prefix to the term denoting the infraspecific rank of <i>this</i> botanical
+    * taxon name. If this flag is set no other hybrid flags may be set.
+    *
+    * @return  the boolean value of the isTrinomHybrid flag
+    * @see     #isHybridFormula()
+    * @see     #isMonomHybrid()
+    * @see     #isBinomHybrid()
+    */
+   public boolean isTrinomHybrid();
+
+
+   /**
+    * Returns the boolean value of the flag intended to protect (true)
+    * or not (false) the {@link #getAuthorshipCache() authorshipCache} (complete authorship string)
+    * of <i>this</i> non viral taxon name.
+    *
+    * @return  the boolean value of the protectedAuthorshipCache flag
+    * @see     #getAuthorshipCache()
+    */
+   public boolean isProtectedAuthorshipCache();
+
+
+   /**
+    * Returns the boolean value of the flag intended to protect (true)
+    * or not (false) the {@link #getNameCache() nameCache} (scientific name without author strings and year)
+    * string of <i>this</i> non viral taxon name.
+    *
+    * @return  the boolean value of the protectedNameCache flag
+    * @see     #getNameCache()
+    */
+   public boolean isProtectedNameCache();
+
+   public void removeHybridChild(NonViralName child);
+
+   public void removeHybridParent(NonViralName parent);
+
+   /**
+    * Removes one {@link HybridRelationship hybrid relationship} from the set of
+    * {@link #getHybridRelationships() hybrid relationships} in which <i>this</i> botanical taxon name
+    * is involved. The hybrid relationship will also be removed from the set
+    * belonging to the second botanical taxon name involved.
+    *
+    * @param  relationship  the hybrid relationship which should be deleted from the corresponding sets
+    * @see                  #getHybridRelationships()
+    */
+   public void removeHybridRelationship(HybridRelationship hybridRelation);
+
+   /**
+    * Assigns an authorshipCache string to <i>this</i> non viral taxon name. Sets the isProtectedAuthorshipCache
+    * flag to <code>true</code>.
+    *
+    * @param  authorshipCache  the string which identifies the complete authorship of <i>this</i> non viral taxon name
+    * @see    #getAuthorshipCache()
+    */
+   public void setAuthorshipCache(String authorshipCache);
+
+
+   /**
+    * Assigns an authorshipCache string to <i>this</i> non viral taxon name.
+    *
+    * @param  authorshipCache  the string which identifies the complete authorship of <i>this</i> non viral taxon name
+    * @param  protectedAuthorshipCache if true the isProtectedAuthorshipCache flag is set to <code>true</code>, otherwise
+    * the flag is set to <code>false</code>.
+    * @see    #getAuthorshipCache()
+    */
+   public void setAuthorshipCache(String authorshipCache, boolean protectedAuthorshipCache);
+
+   /**
+    * @see  #getBasionymAuthorship()
+    */
+   public void setBasionymAuthorship(TeamOrPersonBase<?> basionymAuthorship);
+
+   /**
+    * @see  #isBinomHybrid()
+    * @see  #isMonomHybrid()
+    * @see  #isTrinomHybrid()
+    */
+   public void setBinomHybrid(boolean binomHybrid);
+
+
+   /**
+    * @see  #getCombinationAuthorship()
+    */
+   public void setCombinationAuthorship(TeamOrPersonBase<?> combinationAuthorship);
+
+   /**
+    * @see  #getExBasionymAuthorship()
+    */
+   public void setExBasionymAuthorship(TeamOrPersonBase<?> exBasionymAuthorship);
+
+
+   /**
+    * @see  #getExCombinationAuthorship()
+    */
+   public void setExCombinationAuthorship(TeamOrPersonBase<?> exCombinationAuthorship);
+
+   /**
+    * @see  #getGenusOrUninomial()
+    */
+   public void setGenusOrUninomial(String genusOrUninomial);
+
+   /**
+    * @see  #isHybridFormula()
+    */
+   public void setHybridFormula(boolean hybridFormula);
+
+   /**
+    * @see  #getInfraGenericEpithet()
+    */
+   public void setInfraGenericEpithet(String infraGenericEpithet);
+
+   /**
+    * @see  #getInfraSpecificEpithet()
+    */
+   public void setInfraSpecificEpithet(String infraSpecificEpithet);
+
+   /**
+    * @see  #isMonomHybrid()
+    * @see  #isBinomHybrid()
+    * @see  #isTrinomHybrid()
+    */
+   public void setMonomHybrid(boolean monomHybrid);
+
+   /**
+    * Assigns a nameCache string to <i>this</i> non viral taxon name and protects it from being overwritten.
+    * Sets the protectedNameCache flag to <code>true</code>.
+    *
+    * @param  nameCache  the string which identifies <i>this</i> non viral taxon name (without authors or year)
+    * @see    #getNameCache()
+    */
+   public void setNameCache(String nameCache);
+
+   /**
+    * Assigns a nameCache string to <i>this</i> non viral taxon name and protects it from being overwritten.
+    * Sets the protectedNameCache flag to <code>true</code>.
+    *
+    * @param  nameCache  the string which identifies <i>this</i> non viral taxon name (without authors or year)
+    * @param  protectedNameCache if true teh protectedNameCache is set to <code>true</code> or otherwise set to
+    * <code>false</code>
+    * @see    #getNameCache()
+    */
+   public void setNameCache(String nameCache, boolean protectedNameCache);
+
+   /**
+    * @see     #isProtectedAuthorshipCache()
+    * @see     #getAuthorshipCache()
+    */
+   public void setProtectedAuthorshipCache(boolean protectedAuthorshipCache);
+
+   /**
+    * @see     #isProtectedNameCache()
+    */
+   public void setProtectedNameCache(boolean protectedNameCache);
+
+   /**
+    * @see  #getSpecificEpithet()
+    */
+   public void setSpecificEpithet(String specificEpithet);
+
+   /**
+    * @see  #isTrinomHybrid()
+    * @see  #isBinomHybrid()
+    * @see  #isMonomHybrid()
+    */
+   public void setTrinomHybrid(boolean trinomHybrid);
+
+
+}
diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/ITaxonNameBase.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/ITaxonNameBase.java
new file mode 100644 (file)
index 0000000..20ec26d
--- /dev/null
@@ -0,0 +1,798 @@
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.model.name;
+
+import java.util.List;
+import java.util.Set;
+
+import javax.persistence.Transient;
+
+import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
+import eu.etaxonomy.cdm.model.common.IParsable;
+import eu.etaxonomy.cdm.model.common.IRelated;
+import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.taxon.Synonym;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.cdm.strategy.cache.TaggedText;
+import eu.etaxonomy.cdm.strategy.match.IMatchable;
+
+/**
+ *
+ * The upmost interface for taxon names.
+ * <P>
+ * This class corresponds partially to: <ul>
+ * <li> TaxonName according to the TDWG ontology
+ * <li> ScientificName and CanonicalName according to the TCS
+ * <li> ScientificName according to the ABCD schema
+ * </ul>
+ *
+ * @author a.mueller
+ * @date 21.01.2017
+ *
+ */
+public interface ITaxonNameBase<T extends TaxonNameBase<?,?>>
+        extends IIdentifiableEntity, IParsable, IRelated, IMatchable, Cloneable{
+
+    public String generateFullTitle();
+
+    @Transient
+    public String getFullTitleCache();
+
+    @Transient
+    public NomenclaturalCode getNomenclaturalCode();
+
+
+    /**
+     * Returns the boolean value "false" since the components of <i>this</i> taxon name
+     * cannot follow the rules of a corresponding {@link NomenclaturalCode nomenclatural code}
+     * which is not defined for this class. The nomenclature code depends on
+     * the concrete name subclass ({@link BacterialName BacterialName},
+     * {@link BotanicalName BotanicalName}, {@link CultivarPlantName CultivarPlantName},
+     * {@link ZoologicalName ZoologicalName} or {@link ViralName ViralName})
+     * to which a taxon name belongs.
+     *
+     * @return  false
+     */
+    @Transient
+    public boolean isCodeCompliant();
+
+    public List<TaggedText> getTaggedName();
+
+    public void setFullTitleCache(String fullTitleCache);
+
+    public void setFullTitleCache(String fullTitleCache, boolean protectCache);
+
+    public boolean isProtectedFullTitleCache();
+
+    void setProtectedFullTitleCache(boolean protectedFullTitleCache);
+
+    /**
+     * Returns the set of all {@link NameRelationship name relationships}
+     * in which <i>this</i> taxon name is involved. A taxon name can be both source
+     * in some name relationships or target in some others.
+     *
+     * @see    #getRelationsToThisName()
+     * @see    #getRelationsFromThisName()
+     * @see    #addNameRelationship(NameRelationship)
+     * @see    #addRelationshipToName(TaxonNameBase, NameRelationshipType, String)
+     * @see    #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
+     */
+    public Set<NameRelationship> getNameRelations();
+
+    /**
+     * Creates a new {@link NameRelationship#NameRelationship(TaxonNameBase, TaxonNameBase, NameRelationshipType, String) name relationship} from <i>this</i> taxon name to another taxon name
+     * and adds it both to the set of {@link #getRelationsFromThisName() relations from <i>this</i> taxon name} and
+     * to the set of {@link #getRelationsToThisName() relations to the other taxon name}.
+     *
+     * @param toName          the taxon name of the target for this new name relationship
+     * @param type            the type of this new name relationship
+     * @param ruleConsidered  the string which specifies the rule on which this name relationship is based
+     * @see                   #getRelationsToThisName()
+     * @see                   #getNameRelations()
+     * @see                   #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
+     * @see                   #addNameRelationship(NameRelationship)
+     */
+    public void addRelationshipToName(TaxonNameBase toName, NameRelationshipType type, String ruleConsidered);
+
+    /**
+     * Creates a new {@link NameRelationship#NameRelationship(TaxonNameBase, TaxonNameBase, NameRelationshipType, String) name relationship} from <i>this</i> taxon name to another taxon name
+     * and adds it both to the set of {@link #getRelationsFromThisName() relations from <i>this</i> taxon name} and
+     * to the set of {@link #getRelationsToThisName() relations to the other taxon name}.
+     *
+     * @param toName          the taxon name of the target for this new name relationship
+     * @param type            the type of this new name relationship
+     * @param ruleConsidered  the string which specifies the rule on which this name relationship is based
+     * @return
+     * @see                   #getRelationsToThisName()
+     * @see                   #getNameRelations()
+     * @see                   #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
+     * @see                   #addNameRelationship(NameRelationship)
+     */
+    public NameRelationship addRelationshipToName(TaxonNameBase toName, NameRelationshipType type, Reference citation,
+            String microCitation, String ruleConsidered);
+
+    /**
+     * Creates a new {@link NameRelationship#NameRelationship(TaxonNameBase, TaxonNameBase, NameRelationshipType, String) name relationship} from another taxon name to <i>this</i> taxon name
+     * and adds it both to the set of {@link #getRelationsToThisName() relations to <i>this</i> taxon name} and
+     * to the set of {@link #getRelationsFromThisName() relations from the other taxon name}.
+     *
+     * @param fromName        the taxon name of the source for this new name relationship
+     * @param type            the type of this new name relationship
+     * @param ruleConsidered  the string which specifies the rule on which this name relationship is based
+     * @param citation        the reference in which this relation was described
+     * @param microCitation   the reference detail for this relation (e.g. page)
+     * @see                   #getRelationsFromThisName()
+     * @see                   #getNameRelations()
+     * @see                   #addRelationshipToName(TaxonNameBase, NameRelationshipType, String)
+     * @see                   #addNameRelationship(NameRelationship)
+     */
+    public NameRelationship addRelationshipFromName(TaxonNameBase fromName, NameRelationshipType type, String ruleConsidered);
+
+    /**
+     * Creates a new {@link NameRelationship#NameRelationship(TaxonNameBase, TaxonNameBase, NameRelationshipType, String) name relationship} from another taxon name to <i>this</i> taxon name
+     * and adds it both to the set of {@link #getRelationsToThisName() relations to <i>this</i> taxon name} and
+     * to the set of {@link #getRelationsFromThisName() relations from the other taxon name}.
+     *
+     * @param fromName        the taxon name of the source for this new name relationship
+     * @param type            the type of this new name relationship
+     * @param ruleConsidered  the string which specifies the rule on which this name relationship is based
+     * @param citation        the reference in which this relation was described
+     * @param microCitation   the reference detail for this relation (e.g. page)
+     * @see                   #getRelationsFromThisName()
+     * @see                   #getNameRelations()
+     * @see                   #addRelationshipToName(TaxonNameBase, NameRelationshipType, String)
+     * @see                   #addNameRelationship(NameRelationship)
+     */
+    public NameRelationship addRelationshipFromName(TaxonNameBase fromName, NameRelationshipType type, Reference citation,
+            String microCitation, String ruleConsidered);
+
+    /**
+     * Removes one {@link NameRelationship name relationship} from one of both sets of
+     * {@link #getNameRelations() name relationships} in which <i>this</i> taxon name is involved.
+     * The name relationship will also be removed from one of both sets belonging
+     * to the second taxon name involved. Furthermore the fromName and toName
+     * attributes of the name relationship object will be nullified.
+     *
+     * @param  nameRelation  the name relationship which should be deleted from one of both sets
+     * @see                  #getNameRelations()
+     */
+    public void removeNameRelationship(NameRelationship nameRelation);
+
+    public void removeRelationToTaxonName(TaxonNameBase toTaxonName);
+
+    /**
+     * Returns the set of all {@link NameRelationship name relationships}
+     * in which <i>this</i> taxon name is involved as a source ("from"-side).
+     *
+     * @see    #getNameRelations()
+     * @see    #getRelationsToThisName()
+     * @see    #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
+     */
+    public Set<NameRelationship> getRelationsFromThisName();
+
+    /**
+     * Returns the set of all {@link NameRelationship name relationships}
+     * in which <i>this</i> taxon name is involved as a target ("to"-side).
+     *
+     * @see    #getNameRelations()
+     * @see    #getRelationsFromThisName()
+     * @see    #addRelationshipToName(TaxonNameBase, NameRelationshipType, String)
+     */
+    public Set<NameRelationship> getRelationsToThisName();
+
+    /**
+     * Returns the set of {@link NomenclaturalStatus nomenclatural status} assigned
+     * to <i>this</i> taxon name according to its corresponding nomenclature code.
+     * This includes the {@link NomenclaturalStatusType type} of the nomenclatural status
+     * and the nomenclatural code rule considered.
+     *
+     * @see     NomenclaturalStatus
+     * @see     NomenclaturalStatusType
+     */
+    public Set<NomenclaturalStatus> getStatus();
+
+    /**
+     * Adds a new {@link NomenclaturalStatus nomenclatural status}
+     * to <i>this</i> taxon name's set of nomenclatural status.
+     *
+     * @param  nomStatus  the nomenclatural status to be added
+     * @see               #getStatus()
+     */
+    public void addStatus(NomenclaturalStatus nomStatus);
+
+    public NomenclaturalStatus addStatus(NomenclaturalStatusType statusType, Reference citation, String microCitation);
+
+    /**
+     * Removes one element from the set of nomenclatural status of <i>this</i> taxon name.
+     * Type and ruleConsidered attributes of the nomenclatural status object
+     * will be nullified.
+     *
+     * @param  nomStatus  the nomenclatural status of <i>this</i> taxon name which should be deleted
+     * @see               #getStatus()
+     */
+    public void removeStatus(NomenclaturalStatus nomStatus);
+
+    /**
+     * Indicates whether <i>this</i> taxon name is a {@link NameRelationshipType#BASIONYM() basionym}
+     * or a {@link NameRelationshipType#REPLACED_SYNONYM() replaced synonym}
+     * of any other taxon name. Returns "true", if a basionym or a replaced
+     * synonym {@link NameRelationship relationship} from <i>this</i> taxon name to another taxon name exists,
+     * false otherwise (also in case <i>this</i> taxon name is the only one in the
+     * homotypical group).
+     */
+    public boolean isOriginalCombination();
+
+    /**
+     * Indicates <i>this</i> taxon name is a {@link NameRelationshipType#REPLACED_SYNONYM() replaced synonym}
+     * of any other taxon name. Returns "true", if a replaced
+     * synonym {@link NameRelationship relationship} from <i>this</i> taxon name to another taxon name exists,
+     * false otherwise (also in case <i>this</i> taxon name is the only one in the
+     * homotypical group).
+     */
+    public boolean isReplacedSynonym();
+
+    /**
+     * Returns the taxon name which is the {@link NameRelationshipType#BASIONYM() basionym} of <i>this</i> taxon name.
+     * The basionym of a taxon name is its epithet-bringing synonym.
+     * For instance <i>Pinus abies</i> L. was published by Linnaeus and the botanist
+     * Karsten transferred later <i>this</i> taxon to the genus Picea. Therefore,
+     * <i>Pinus abies</i> L. is the basionym of the new combination <i>Picea abies</i> (L.) H. Karst.
+     *
+     * If more than one basionym exists one is choosen at radom.
+     *
+     * If no basionym exists null is returned.
+     */
+    public TaxonNameBase getBasionym();
+
+    /**
+     * Returns the set of taxon names which are the {@link NameRelationshipType#BASIONYM() basionyms} of <i>this</i> taxon name.
+     * The basionym of a taxon name is its epithet-bringing synonym.
+     * For instance <i>Pinus abies</i> L. was published by Linnaeus and the botanist
+     * Karsten transferred later <i>this</i> taxon to the genus Picea. Therefore,
+     * <i>Pinus abies</i> L. is the basionym of the new combination <i>Picea abies</i> (L.) H. Karst.
+     */
+    public Set<TaxonNameBase> getBasionyms();
+
+    /**
+     * Assigns a taxon name as {@link NameRelationshipType#BASIONYM() basionym} of <i>this</i> taxon name.
+     * The basionym {@link NameRelationship relationship} will be added to <i>this</i> taxon name
+     * and to the basionym. The basionym cannot have itself a basionym.
+     * The {@link HomotypicalGroup homotypical groups} of <i>this</i> taxon name and of the basionym
+     * will be {@link HomotypicalGroup#merge(HomotypicalGroup) merged}.
+     *
+     * @param  basionym     the taxon name to be set as the basionym of <i>this</i> taxon name
+     * @see                 #getBasionym()
+     * @see                 #addBasionym(TaxonNameBase, String)
+     */
+    public void addBasionym(T basionym);
+
+    /**
+     * Assigns a taxon name as {@link NameRelationshipType#BASIONYM() basionym} of <i>this</i> taxon name
+     * and keeps the nomenclatural rule considered for it. The basionym
+     * {@link NameRelationship relationship} will be added to <i>this</i> taxon name and to the basionym.
+     * The basionym cannot have itself a basionym.
+     * The {@link HomotypicalGroup homotypical groups} of <i>this</i> taxon name and of the basionym
+     * will be {@link HomotypicalGroup#merge(HomotypicalGroup) merged}.
+     *
+     * @param  basionym         the taxon name to be set as the basionym of <i>this</i> taxon name
+     * @param  ruleConsidered   the string identifying the nomenclatural rule
+     * @return
+     * @see                     #getBasionym()
+     * @see                     #addBasionym(TaxonNameBase)
+     */
+    public NameRelationship addBasionym(T basionym, Reference citation, String microcitation, String ruleConsidered);
+
+    /**
+     * Returns the set of taxon names which are the {@link NameRelationshipType#REPLACED_SYNONYM() replaced synonyms} of <i>this</i> taxon name.
+     *
+     */
+    public Set<TaxonNameBase> getReplacedSynonyms();
+
+    /**
+     * Assigns a taxon name as {@link NameRelationshipType#REPLACED_SYNONYM() replaced synonym} of <i>this</i> taxon name
+     * and keeps the nomenclatural rule considered for it. The replaced synonym
+     * {@link NameRelationship relationship} will be added to <i>this</i> taxon name and to the replaced synonym.
+     * The {@link HomotypicalGroup homotypical groups} of <i>this</i> taxon name and of the replaced synonym
+     * will be {@link HomotypicalGroup#merge(HomotypicalGroup) merged}.
+     *
+     * @param  basionym         the taxon name to be set as the basionym of <i>this</i> taxon name
+     * @param  ruleConsidered   the string identifying the nomenclatural rule
+     * @see                     #getBasionym()
+     * @see                     #addBasionym(TaxonNameBase)
+     */
+    //TODO: Check if true: The replaced synonym cannot have itself a replaced synonym (?).
+    public void addReplacedSynonym(T replacedSynonym, Reference citation, String microcitation, String ruleConsidered);
+
+    /**
+     * Removes the {@link NameRelationshipType#BASIONYM() basionym} {@link NameRelationship relationship} from the set of
+     * {@link #getRelationsToThisName() name relationships to} <i>this</i> taxon name. The same relationhip will be
+     * removed from the set of {@link #getRelationsFromThisName() name relationships from} the taxon name
+     * previously used as basionym.
+     *
+     * @see   #getBasionym()
+     * @see   #addBasionym(TaxonNameBase)
+     */
+    public void removeBasionyms();
+
+    /**
+     * Returns the taxonomic {@link Rank rank} of <i>this</i> taxon name.
+     *
+     * @see     Rank
+     */
+    public Rank getRank();
+
+    /**
+     * @see  #getRank()
+     */
+    public void setRank(Rank rank);
+
+    /**
+     * Returns the {@link eu.etaxonomy.cdm.model.reference.INomenclaturalReference nomenclatural reference} of <i>this</i> taxon name.
+     * The nomenclatural reference is here meant to be the one publication
+     * <i>this</i> taxon name was originally published in while fulfilling the formal
+     * requirements as specified by the corresponding {@link NomenclaturalCode nomenclatural code}.
+     *
+     * @see     eu.etaxonomy.cdm.model.reference.INomenclaturalReference
+     * @see     eu.etaxonomy.cdm.model.reference.Reference
+     */
+    public INomenclaturalReference getNomenclaturalReference();
+
+    /**
+     * Assigns a {@link eu.etaxonomy.cdm.model.reference.INomenclaturalReference nomenclatural reference} to <i>this</i> taxon name.
+     * The corresponding {@link eu.etaxonomy.cdm.model.reference.Reference.isNomenclaturallyRelevant nomenclaturally relevant flag} will be set to true
+     * as it is obviously used for nomenclatural purposes.
+     *
+     * @throws IllegalArgumentException if parameter <code>nomenclaturalReference</code> is not assignable from {@link INomenclaturalReference}
+     * @see  #getNomenclaturalReference()
+     */
+    public void setNomenclaturalReference(INomenclaturalReference nomenclaturalReference);
+
+    /**
+     * Returns the appended phrase string assigned to <i>this</i> taxon name.
+     * The appended phrase is a non-atomised addition to a name. It is
+     * not ruled by a nomenclatural code.
+     */
+    public String getAppendedPhrase();
+
+    /**
+     * @see  #getAppendedPhrase()
+     */
+    public void setAppendedPhrase(String appendedPhrase);
+
+    /**
+     * Returns the details string of the {@link #getNomenclaturalReference() nomenclatural reference} assigned
+     * to <i>this</i> taxon name. The details describe the exact localisation within
+     * the publication used as nomenclature reference. These are mostly
+     * (implicitly) pages but can also be figures or tables or any other
+     * element of a publication. A nomenclatural micro reference (details)
+     * requires the existence of a nomenclatural reference.
+     */
+    //Details of the nomenclatural reference (protologue).
+    public String getNomenclaturalMicroReference();
+
+    /**
+     * @see  #getNomenclaturalMicroReference()
+     */
+    public void setNomenclaturalMicroReference(String nomenclaturalMicroReference);
+
+    /**
+     * @param warnings
+     */
+    public void addParsingProblems(int problems);
+
+    /**
+     * Returns the set of {@link TypeDesignationBase type designations} assigned
+     * to <i>this</i> taxon name.
+     * @see     NameTypeDesignation
+     * @see     SpecimenTypeDesignation
+     */
+    public Set<TypeDesignationBase> getTypeDesignations();
+
+    /**
+     * Removes one element from the set of {@link TypeDesignationBase type designations} assigned to
+     * <i>this</i> taxon name. The type designation itself will be nullified.
+     *
+     * @param  typeDesignation  the type designation which should be deleted
+     */
+    public void removeTypeDesignation(TypeDesignationBase typeDesignation);
+
+    /**
+     * Returns the set of {@link SpecimenTypeDesignation specimen type designations} assigned
+     * to <i>this</i> taxon name. The {@link Rank rank} of <i>this</i> taxon name is generally
+     * "species" or below. The specimen type designations include all the
+     * specimens on which the typification of this name is based (which are
+     * exclusively used to typify taxon names belonging to the same
+     * {@link HomotypicalGroup homotypical group} to which <i>this</i> taxon name
+     * belongs) and eventually the status of these designations.
+     *
+     * @see     SpecimenTypeDesignation
+     * @see     NameTypeDesignation
+     * @see     HomotypicalGroup
+     */
+    public Set<SpecimenTypeDesignation> getSpecimenTypeDesignationsOfHomotypicalGroup();
+
+    /**
+     * Returns the set of {@link NameTypeDesignation name type designations} assigned
+     * to <i>this</i> taxon name the rank of which must be above "species".
+     * The name type designations include all the taxon names used to typify
+     * <i>this</i> taxon name and eventually the rejected or conserved status
+     * of these designations.
+     *
+     * @see     NameTypeDesignation
+     * @see     SpecimenTypeDesignation
+     */
+    public Set<NameTypeDesignation> getNameTypeDesignations();
+
+    /**
+     * Creates and adds a new {@link NameTypeDesignation name type designation}
+     * to <i>this</i> taxon name's set of type designations.
+     *
+     * @param  typeSpecies              the taxon name to be used as type of <i>this</i> taxon name
+     * @param  citation                 the reference for this new designation
+     * @param  citationMicroReference   the string with the details (generally pages) within the reference
+     * @param  originalNameString       the taxon name string used in the reference to assert this designation
+     * @param  isRejectedType           the boolean status for a rejected name type designation
+     * @param  isConservedType          the boolean status for a conserved name type designation
+     * @param  isLectoType              the boolean status for a lectotype name type designation
+     * @param  isNotDesignated          the boolean status for a name type designation without name type
+     * @param  addToAllHomotypicNames   the boolean indicating whether the name type designation should be
+     *                                  added to all taxon names of the homotypical group this taxon name belongs to
+     * @return
+     * @see                             #getNameTypeDesignations()
+     * @see                             NameTypeDesignation
+     * @see                             TypeDesignationBase#isNotDesignated()
+     */
+    public NameTypeDesignation addNameTypeDesignation(TaxonNameBase typeSpecies, Reference citation,
+            String citationMicroReference, String originalNameString, NameTypeDesignationStatus status,
+            boolean isRejectedType, boolean isConservedType,
+            /*boolean isLectoType, */
+            boolean isNotDesignated, boolean addToAllHomotypicNames);
+
+    /**
+     * Creates and adds a new {@link NameTypeDesignation name type designation}
+     * to <i>this</i> taxon name's set of type designations.
+     *
+     * @param  typeSpecies              the taxon name to be used as type of <i>this</i> taxon name
+     * @param  citation                 the reference for this new designation
+     * @param  citationMicroReference   the string with the details (generally pages) within the reference
+     * @param  originalNameString       the taxon name string used in the reference to assert this designation
+     * @param  status                   the name type designation status
+     * @param  addToAllHomotypicNames   the boolean indicating whether the name type designation should be
+     *                                  added to all taxon names of the homotypical group this taxon name belongs to
+     * @return
+     * @see                             #getNameTypeDesignations()
+     * @see                             NameTypeDesignation
+     * @see                             TypeDesignationBase#isNotDesignated()
+     */
+    public NameTypeDesignation addNameTypeDesignation(TaxonNameBase typeSpecies, Reference citation,
+            String citationMicroReference, String originalNameString, NameTypeDesignationStatus status,
+            boolean addToAllHomotypicNames);
+
+    /**
+     * Returns the set of {@link SpecimenTypeDesignation specimen type designations}
+     * that typify <i>this</i> taxon name.
+     */
+    public Set<SpecimenTypeDesignation> getSpecimenTypeDesignations();
+
+    /**
+     * Creates and adds a new {@link SpecimenTypeDesignation specimen type designation}
+     * to <i>this</i> taxon name's set of type designations.
+     *
+     * @param  typeSpecimen             the specimen to be used as a type for <i>this</i> taxon name
+     * @param  status                   the specimen type designation status
+     * @param  citation                 the reference for this new specimen type designation
+     * @param  citationMicroReference   the string with the details (generally pages) within the reference
+     * @param  originalNameString       the taxon name used in the reference to assert this designation
+     * @param  isNotDesignated          the boolean status for a specimen type designation without specimen type
+     * @param  addToAllHomotypicNames   the boolean indicating whether the specimen type designation should be
+     *                                  added to all taxon names of the homotypical group the typified
+     *                                  taxon name belongs to
+     * @return
+     * @see                             #getSpecimenTypeDesignations()
+     * @see                             SpecimenTypeDesignationStatus
+     * @see                             SpecimenTypeDesignation
+     * @see                             TypeDesignationBase#isNotDesignated()
+     */
+    public SpecimenTypeDesignation addSpecimenTypeDesignation(DerivedUnit typeSpecimen, SpecimenTypeDesignationStatus status,
+            Reference citation, String citationMicroReference, String originalNameString, boolean isNotDesignated,
+            boolean addToAllHomotypicNames);
+
+    /**
+     * Adds a {@link TypeDesignationBase type designation} to <code>this</code> taxon name's set of type designations
+     *
+     * @param typeDesignation           the typeDesignation to be added to <code>this</code> taxon name
+     * @param addToAllNames             the boolean indicating whether the type designation should be
+     *                                  added to all taxon names of the homotypical group the typified
+     *                                  taxon name belongs to
+     * @return                          true if the operation was succesful
+     *
+     * @throws IllegalArgumentException if the type designation already has typified names, an {@link IllegalArgumentException exception}
+     *                                  is thrown. We do this to prevent a type designation to be used for multiple taxon names.
+     *
+     */
+    public boolean addTypeDesignation(TypeDesignationBase typeDesignation, boolean addToAllNames);
+
+    /**
+     * Returns the {@link HomotypicalGroup homotypical group} to which
+     * <i>this</i> taxon name belongs. A homotypical group represents all taxon names
+     * that share the same types.
+     *
+     * @see     HomotypicalGroup
+     */
+
+    public HomotypicalGroup getHomotypicalGroup();
+
+    /**
+     * @see #getHomotypicalGroup()
+     */
+    public void setHomotypicalGroup(HomotypicalGroup homotypicalGroup);
+
+    /**
+     * Returns the complete string containing the
+     * {@link eu.etaxonomy.cdm.model.reference.INomenclaturalReference#getNomenclaturalCitation() nomenclatural reference citation}
+     * and the {@link #getNomenclaturalMicroReference() details} assigned to <i>this</i> taxon name.
+     *
+     * @return  the string containing the nomenclatural reference of <i>this</i> taxon name
+     * @see     eu.etaxonomy.cdm.model.reference.INomenclaturalReference#getNomenclaturalCitation()
+     * @see     #getNomenclaturalReference()
+     * @see     #getNomenclaturalMicroReference()
+     */
+    public String getCitationString();
+
+    /**
+     * Returns the string containing the publication date (generally only year)
+     * of the {@link #getNomenclaturalReference() nomenclatural reference} for <i>this</i> taxon name, null if there is
+     * no nomenclatural reference.
+     *
+     * @return  the string containing the publication date of <i>this</i> taxon name
+     * @see     eu.etaxonomy.cdm.model.reference.INomenclaturalReference#getYear()
+     */
+    public String getReferenceYear();
+
+    /**
+     * Returns the set of {@link eu.etaxonomy.cdm.model.taxon.TaxonBase taxon bases} that refer to <i>this</i> taxon name.
+     * In this context a taxon base means the use of a taxon name by a reference
+     * either as a {@link eu.etaxonomy.cdm.model.taxon.Taxon taxon} ("accepted/correct" name) or
+     * as a (junior) {@link eu.etaxonomy.cdm.model.taxon.Synonym synonym}.
+     * A taxon name can be used by several distinct {@link eu.etaxonomy.cdm.model.reference.Reference references} but only once
+     * within a taxonomic treatment (identified by one reference).
+     *
+     * @see #getTaxa()
+     * @see #getSynonyms()
+     */
+    public Set<TaxonBase> getTaxonBases();
+
+    /**
+     * Adds a new {@link eu.etaxonomy.cdm.model.taxon.TaxonBase taxon base}
+     * to the set of taxon bases using <i>this</i> taxon name.
+     *
+     * @param  taxonBase  the taxon base to be added
+     * @see               #getTaxonBases()
+     * @see               #removeTaxonBase(TaxonBase)
+     */
+    //TODO protected
+    public void addTaxonBase(TaxonBase taxonBase);
+
+    /**
+     * Removes one element from the set of {@link eu.etaxonomy.cdm.model.taxon.TaxonBase taxon bases} that refer to <i>this</i> taxon name.
+     *
+     * @param  taxonBase    the taxon base which should be removed from the corresponding set
+     * @see                 #getTaxonBases()
+     * @see                 #addTaxonBase(TaxonBase)
+     */
+    public void removeTaxonBase(TaxonBase taxonBase);
+
+    /**
+     * Returns the set of {@link eu.etaxonomy.cdm.model.taxon.Taxon taxa} ("accepted/correct" names according to any
+     * reference) that are based on <i>this</i> taxon name. This set is a subset of
+     * the set returned by getTaxonBases().
+     *
+     * @see eu.etaxonomy.cdm.model.taxon.Taxon
+     * @see #getTaxonBases()
+     * @see #getSynonyms()
+     */
+    public Set<Taxon> getTaxa();
+
+    /**
+     * Returns the set of {@link eu.etaxonomy.cdm.model.taxon.Synonym (junior) synonyms} (according to any
+     * reference) that are based on <i>this</i> taxon name. This set is a subset of
+     * the set returned by getTaxonBases().
+     *
+     * @see eu.etaxonomy.cdm.model.taxon.Synonym
+     * @see #getTaxonBases()
+     * @see #getTaxa()
+     */
+    public Set<Synonym> getSynonyms();
+
+    /**
+     * Returns the set of {@link eu.etaxonomy.cdm.model.description.TaxonNameDescription taxon name descriptions} assigned
+     * to <i>this</i> taxon name. A taxon name description is a piece of information
+     * concerning the taxon name like for instance the content of its first
+     * publication (protolog) or a picture of this publication.
+     *
+     * @see #addDescription(TaxonNameDescription)
+     * @see #removeDescription(TaxonNameDescription)
+     * @see eu.etaxonomy.cdm.model.description.TaxonNameDescription
+     */
+    public Set<TaxonNameDescription> getDescriptions();
+
+    /**
+     * Adds a new {@link eu.etaxonomy.cdm.model.description.TaxonNameDescription taxon name description}
+     * to the set of taxon name descriptions assigned to <i>this</i> taxon name. The
+     * content of the {@link eu.etaxonomy.cdm.model.description.TaxonNameDescription#getTaxonName() taxonName attribute} of the
+     * taxon name description itself will be replaced with <i>this</i> taxon name.
+     *
+     * @param  description  the taxon name description to be added
+     * @see                 #getDescriptions()
+     * @see                 #removeDescription(TaxonNameDescription)
+     */
+    public void addDescription(TaxonNameDescription description);
+
+    /**
+     * Removes one element from the set of {@link eu.etaxonomy.cdm.model.description.TaxonNameDescription taxon name descriptions} assigned
+     * to <i>this</i> taxon name. The content of the {@link eu.etaxonomy.cdm.model.description.TaxonNameDescription#getTaxonName() taxonName attribute}
+     * of the description itself will be set to "null".
+     *
+     * @param  description  the taxon name description which should be removed
+     * @see                 #getDescriptions()
+     * @see                 #addDescription(TaxonNameDescription)
+     * @see                 eu.etaxonomy.cdm.model.description.TaxonNameDescription#getTaxonName()
+     */
+    public void removeDescription(TaxonNameDescription description);
+
+    public void mergeHomotypicGroups(TaxonNameBase name);
+
+    /**
+     * Returns the boolean value indicating whether a given taxon name belongs
+     * to the same {@link HomotypicalGroup homotypical group} as <i>this</i> taxon name (true)
+     * or not (false). Returns "true" only if the homotypical groups of both
+     * taxon names exist and if they are identical.
+     *
+     * @param   homoTypicName  the taxon name the homotypical group of which is to be checked
+     * @return                 the boolean value of the check
+     * @see                    HomotypicalGroup
+     */
+    public boolean isHomotypic(TaxonNameBase homoTypicName);
+
+    /**
+     * Checks whether name is a basionym for ALL names
+     * in its homotypical group.
+     * Returns <code>false</code> if there are no other names in the group
+     * @param name
+     * @return
+     */
+    public boolean isGroupsBasionym();
+
+    /**
+     * Checks whether a basionym relationship exists between fromName and toName.
+     *
+     * @param fromName
+     * @param toName
+     * @return
+     */
+    public boolean isBasionymFor(TaxonNameBase newCombinationName);
+
+    /**
+     * Creates a basionym relationship to all other names in this names homotypical
+     * group.
+     *
+     * @see HomotypicalGroup.setGroupBasionym(TaxonNameBase basionymName)
+     */
+    public void makeGroupsBasionym();
+
+    //*********  Rank comparison shortcuts   ********************//
+    /**
+     * Returns the boolean value indicating whether the taxonomic {@link Rank rank} of <i>this</i>
+     * taxon name is higher than the genus rank (true) or not (false).
+     * Suprageneric non viral names are monomials.
+     * Returns false if rank is null.
+     *
+     * @see  #isGenus()
+     * @see  #isInfraGeneric()
+     * @see  #isSpecies()
+     * @see  #isInfraSpecific()
+     */
+    public boolean isSupraGeneric();
+
+    /**
+     * Returns the boolean value indicating whether the taxonomic {@link Rank rank} of <i>this</i>
+     * taxon name is the genus rank (true) or not (false). Non viral names with
+     * genus rank are monomials. Returns false if rank is null.
+     *
+     * @see  #isSupraGeneric()
+     * @see  #isInfraGeneric()
+     * @see  #isSpecies()
+     * @see  #isInfraSpecific()
+     */
+    public boolean isGenus();
+
+    /**
+     * Returns the boolean value indicating whether the taxonomic {@link Rank rank} of <i>this</i>
+     * taxon name is higher than the species rank and lower than the
+     * genus rank (true) or not (false). Infrageneric non viral names are
+     * binomials. Returns false if rank is null.
+     *
+     * @see  #isSupraGeneric()
+     * @see  #isGenus()
+     * @see  #isSpecies()
+     * @see  #isInfraSpecific()
+     */
+    public boolean isInfraGeneric();
+
+    /**
+     * Returns the boolean value indicating whether the taxonomic {@link Rank rank} of <i>this</i>
+     * taxon name is higher than the species rank (true) or not (false).
+     * Returns false if rank is null.
+     *
+     * @see  #isGenus()
+     * @see  #isInfraGeneric()
+     * @see  #isSpecies()
+     * @see  #isInfraSpecific()
+     */
+    public boolean isSupraSpecific();
+
+    /**
+     * Returns the boolean value indicating whether the taxonomic {@link Rank rank} of <i>this</i>
+     * taxon name is the species rank (true) or not (false). Non viral names
+     * with species rank are binomials.
+     * Returns false if rank is null.
+     *
+     * @see  #isSupraGeneric()
+     * @see  #isGenus()
+     * @see  #isInfraGeneric()
+     * @see  #isInfraSpecific()
+     */
+    public boolean isSpecies();
+
+    /**
+     * Returns the boolean value indicating whether the taxonomic {@link Rank rank} of <i>this</i>
+     * taxon name is lower than the species rank (true) or not (false).
+     * Infraspecific non viral names are trinomials.
+     * Returns false if rank is null.
+     *
+     * @see  #isSupraGeneric()
+     * @see  #isGenus()
+     * @see  #isInfraGeneric()
+     * @see  #isSpecies()
+     */
+    public boolean isInfraSpecific();
+
+    /**
+     * Returns true if this name's rank indicates a rank that aggregates species like species
+     * aggregates or species groups, false otherwise. This methods currently returns false
+     * for all user defined ranks.
+     *
+     *@see Rank#isSpeciesAggregate()
+     *
+     * @return
+     */
+    public boolean isSpeciesAggregate();
+
+    /**
+     * Creates a basionym relationship between this name and
+     *  each name in its homotypic group.
+     *
+     * @param basionymName
+     */
+    public void setAsGroupsBasionym();
+
+    /**
+     * Removes basionym relationship between this name and
+     *  each name in its homotypic group.
+     *
+     * @param basionymName
+     */
+    public void removeAsGroupsBasionym();
+
+
+}
index 1a84af309d1224636f3adc2d14911baa9015b4c6..2253287faf4d94a56fb1d8e266c653ca59795341 100644 (file)
@@ -56,7 +56,10 @@ import eu.etaxonomy.cdm.validation.annotation.NoDuplicateNames;
 @CorrectEpithetsForRank(groups = Level2.class)
 @NameMustHaveAuthority(groups = Level2.class)
 @NoDuplicateNames(groups = Level3.class)
-public class NonViralName<T extends NonViralName> extends TaxonNameBase<T, INonViralNameCacheStrategy> implements Cloneable{
+public class NonViralName<T extends NonViralName>
+        extends TaxonNameBase<T, INonViralNameCacheStrategy>
+        implements INonViralName<T>{
+
     private static final long serialVersionUID = 4441110073881088033L;
 
 
index 38a12a3ce217ae286968316dfd284d5f9dfb4316..c453783f840d9c02ee46f40ef0ecb5f86498c15f 100644 (file)
@@ -150,7 +150,7 @@ import eu.etaxonomy.cdm.validation.annotation.ValidTaxonomicYear;
 @Table(appliesTo="TaxonNameBase", indexes = { @org.hibernate.annotations.Index(name = "taxonNameBaseTitleCacheIndex", columnNames = { "titleCache" }),  @org.hibernate.annotations.Index(name = "taxonNameBaseNameCacheIndex", columnNames = { "nameCache" }) })
 public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INameCacheStrategy>
             extends IdentifiableEntity<S>
-            implements IParsable, IRelated, IMatchable, Cloneable {
+            implements ITaxonNameBase<T>, IParsable, IRelated, IMatchable, Cloneable {
 
     private static final long serialVersionUID = -4530368639601532116L;
     private static final Logger logger = Logger.getLogger(TaxonNameBase.class);
@@ -956,10 +956,12 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
         this.hybridChildRelations = hybridChildRelations;
     }
 
+    @Override
     public boolean isProtectedFullTitleCache() {
         return protectedFullTitleCache;
     }
 
+    @Override
     public void setProtectedFullTitleCache(boolean protectedFullTitleCache) {
         this.protectedFullTitleCache = protectedFullTitleCache;
     }
@@ -1126,6 +1128,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
 
 //********* METHODS **************************************/
 
+    @Override
     public String generateFullTitle(){
         if (cacheStrategy == null){
             logger.warn("No CacheStrategy defined for nonViralName: " + this.getUuid());
@@ -1136,10 +1139,12 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
     }
 
 
+    @Override
     public void setFullTitleCache(String fullTitleCache){
         setFullTitleCache(fullTitleCache, PROTECTED);
     }
 
+    @Override
     public void setFullTitleCache(String fullTitleCache, boolean protectCache){
         fullTitleCache = getTruncatedCache(fullTitleCache);
         this.fullTitleCache = fullTitleCache;
@@ -1165,6 +1170,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      *
      * @return  false
      */
+    @Override
     @Transient
     public boolean isCodeCompliant() {
         //FIXME
@@ -1172,11 +1178,13 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
         return false;
     }
 
+    @Override
     @Transient
     public List<TaggedText> getTaggedName(){
         return getCacheStrategy().getTaggedTitle(this);
     }
 
+    @Override
     @Transient
     public String getFullTitleCache(){
         if (protectedFullTitleCache){
@@ -1356,6 +1364,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see    #addRelationshipToName(TaxonNameBase, NameRelationshipType, String)
      * @see    #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
      */
+    @Override
     @Transient
     public Set<NameRelationship> getNameRelations() {
         Set<NameRelationship> rels = new HashSet<NameRelationship>();
@@ -1377,6 +1386,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see                                      #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
      * @see                                      #addNameRelationship(NameRelationship)
      */
+    @Override
     public void addRelationshipToName(TaxonNameBase toName, NameRelationshipType type, String ruleConsidered){
         addRelationshipToName(toName, type, null, null, ruleConsidered);
         //             NameRelationship rel = new NameRelationship(toName, this, type, ruleConsidered);
@@ -1396,6 +1406,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see                                      #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
      * @see                                      #addNameRelationship(NameRelationship)
      */
+    @Override
     public NameRelationship addRelationshipToName(TaxonNameBase toName, NameRelationshipType type, Reference citation, String microCitation, String ruleConsidered){
         if (toName == null){
             throw new NullPointerException("Null is not allowed as name for a name relationship");
@@ -1419,6 +1430,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see                                      #addRelationshipToName(TaxonNameBase, NameRelationshipType, String)
      * @see                                      #addNameRelationship(NameRelationship)
      */
+    @Override
     public NameRelationship addRelationshipFromName(TaxonNameBase fromName, NameRelationshipType type, String ruleConsidered){
         //fromName.addRelationshipToName(this, type, null, null, ruleConsidered);
         return this.addRelationshipFromName(fromName, type, null, null, ruleConsidered);
@@ -1438,6 +1450,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see                                      #addRelationshipToName(TaxonNameBase, NameRelationshipType, String)
      * @see                                      #addNameRelationship(NameRelationship)
      */
+    @Override
     public NameRelationship addRelationshipFromName(TaxonNameBase fromName, NameRelationshipType type, Reference citation, String microCitation, String ruleConsidered){
         return fromName.addRelationshipToName(this, type, citation, microCitation, ruleConsidered);
     }
@@ -1479,6 +1492,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @param  nameRelation  the name relationship which should be deleted from one of both sets
      * @see                                     #getNameRelations()
      */
+    @Override
     public void removeNameRelationship(NameRelationship nameRelation) {
 
         TaxonNameBase fromName = nameRelation.getFromName();
@@ -1501,6 +1515,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
         this.relationsFromThisName.remove(nameRelation);
     }
 
+    @Override
     public void removeRelationToTaxonName(TaxonNameBase toTaxonName) {
         Set<NameRelationship> nameRelationships = new HashSet<NameRelationship>();
 //             nameRelationships.addAll(this.getNameRelations());
@@ -1551,6 +1566,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see    #getRelationsToThisName()
      * @see    #addRelationshipFromName(TaxonNameBase, NameRelationshipType, String)
      */
+    @Override
     public Set<NameRelationship> getRelationsFromThisName() {
         if(relationsFromThisName == null) {
             this.relationsFromThisName = new HashSet<>();
@@ -1566,6 +1582,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see    #getRelationsFromThisName()
      * @see    #addRelationshipToName(TaxonNameBase, NameRelationshipType, String)
      */
+    @Override
     public Set<NameRelationship> getRelationsToThisName() {
         if(relationsToThisName == null) {
             this.relationsToThisName = new HashSet<>();
@@ -1582,6 +1599,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see     NomenclaturalStatus
      * @see     NomenclaturalStatusType
      */
+    @Override
     public Set<NomenclaturalStatus> getStatus() {
         if(status == null) {
             this.status = new HashSet<>();
@@ -1596,9 +1614,11 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @param  nomStatus  the nomenclatural status to be added
      * @see                      #getStatus()
      */
+    @Override
     public void addStatus(NomenclaturalStatus nomStatus) {
         this.status.add(nomStatus);
     }
+    @Override
     public NomenclaturalStatus addStatus(NomenclaturalStatusType statusType, Reference citation, String microCitation) {
         NomenclaturalStatus newStatus = NomenclaturalStatus.NewInstance(statusType, citation, microCitation);
         this.status.add(newStatus);
@@ -1613,6 +1633,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @param  nomStatus  the nomenclatural status of <i>this</i> taxon name which should be deleted
      * @see                      #getStatus()
      */
+    @Override
     public void removeStatus(NomenclaturalStatus nomStatus) {
         //TODO to be implemented?
         logger.warn("not yet fully implemented?");
@@ -1695,6 +1716,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * false otherwise (also in case <i>this</i> taxon name is the only one in the
      * homotypical group).
      */
+    @Override
     @Transient
     public boolean isOriginalCombination(){
         Set<NameRelationship> relationsFromThisName = this.getRelationsFromThisName();
@@ -1714,6 +1736,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * false otherwise (also in case <i>this</i> taxon name is the only one in the
      * homotypical group).
      */
+    @Override
     @Transient
     public boolean isReplacedSynonym(){
         Set<NameRelationship> relationsFromThisName = this.getRelationsFromThisName();
@@ -1736,6 +1759,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      *
      * If no basionym exists null is returned.
      */
+    @Override
     @Transient
     public TaxonNameBase getBasionym(){
         Set<TaxonNameBase> basionyms = getBasionyms();
@@ -1753,6 +1777,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * Karsten transferred later <i>this</i> taxon to the genus Picea. Therefore,
      * <i>Pinus abies</i> L. is the basionym of the new combination <i>Picea abies</i> (L.) H. Karst.
      */
+    @Override
     @Transient
     public Set<TaxonNameBase> getBasionyms(){
         Set<TaxonNameBase> result = new HashSet<TaxonNameBase>();
@@ -1777,6 +1802,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see                            #getBasionym()
      * @see                            #addBasionym(TaxonNameBase, String)
      */
+    @Override
     public void addBasionym(T basionym){
         addBasionym(basionym, null, null, null);
     }
@@ -1794,6 +1820,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see                                    #getBasionym()
      * @see                                    #addBasionym(TaxonNameBase)
      */
+    @Override
     public NameRelationship addBasionym(T basionym, Reference citation, String microcitation, String ruleConsidered){
         if (basionym != null){
             return basionym.addRelationshipToName(this, NameRelationshipType.BASIONYM(), citation, microcitation, ruleConsidered);
@@ -1806,6 +1833,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * Returns the set of taxon names which are the {@link NameRelationshipType#REPLACED_SYNONYM() replaced synonyms} of <i>this</i> taxon name.
      *
      */
+    @Override
     @Transient
     public Set<TaxonNameBase> getReplacedSynonyms(){
         Set<TaxonNameBase> result = new HashSet<TaxonNameBase>();
@@ -1832,6 +1860,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see                                    #addBasionym(TaxonNameBase)
      */
     //TODO: Check if true: The replaced synonym cannot have itself a replaced synonym (?).
+    @Override
     public void addReplacedSynonym(T replacedSynonym, Reference citation, String microcitation, String ruleConsidered){
         if (replacedSynonym != null){
             replacedSynonym.addRelationshipToName(this, NameRelationshipType.REPLACED_SYNONYM(), citation, microcitation, ruleConsidered);
@@ -1847,6 +1876,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see   #getBasionym()
      * @see   #addBasionym(TaxonNameBase)
      */
+    @Override
     public void removeBasionyms(){
         Set<NameRelationship> removeRelations = new HashSet<NameRelationship>();
         for (NameRelationship nameRelation : this.getRelationsToThisName()){
@@ -1867,6 +1897,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      *
      * @see    Rank
      */
+    @Override
     public Rank getRank(){
         return this.rank;
     }
@@ -1874,6 +1905,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
     /**
      * @see  #getRank()
      */
+    @Override
     public void setRank(Rank rank){
         this.rank = rank;
     }
@@ -1887,6 +1919,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see    eu.etaxonomy.cdm.model.reference.INomenclaturalReference
      * @see    eu.etaxonomy.cdm.model.reference.Reference
      */
+    @Override
     public INomenclaturalReference getNomenclaturalReference(){
         return this.nomenclaturalReference;
     }
@@ -1898,6 +1931,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @throws IllegalArgumentException if parameter <code>nomenclaturalReference</code> is not assignable from {@link INomenclaturalReference}
      * @see  #getNomenclaturalReference()
      */
+    @Override
     public void setNomenclaturalReference(INomenclaturalReference nomenclaturalReference){
         if(nomenclaturalReference != null){
             if(!INomenclaturalReference.class.isAssignableFrom(nomenclaturalReference.getClass())){
@@ -1914,6 +1948,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * The appended phrase is a non-atomised addition to a name. It is
      * not ruled by a nomenclatural code.
      */
+    @Override
     public String getAppendedPhrase(){
         return this.appendedPhrase;
     }
@@ -1921,6 +1956,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
     /**
      * @see  #getAppendedPhrase()
      */
+    @Override
     public void setAppendedPhrase(String appendedPhrase){
         this.appendedPhrase = StringUtils.isBlank(appendedPhrase)? null : appendedPhrase;
     }
@@ -1934,12 +1970,14 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * requires the existence of a nomenclatural reference.
      */
     //Details of the nomenclatural reference (protologue).
+    @Override
     public String getNomenclaturalMicroReference(){
         return this.nomenclaturalMicroReference;
     }
     /**
      * @see  #getNomenclaturalMicroReference()
      */
+    @Override
     public void setNomenclaturalMicroReference(String nomenclaturalMicroReference){
         this.nomenclaturalMicroReference = StringUtils.isBlank(nomenclaturalMicroReference)? null : nomenclaturalMicroReference;
     }
@@ -1967,6 +2005,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
     /**
      * @param warnings
      */
+    @Override
     public void addParsingProblems(int problems){
         parsingProblem = ParserProblem.addProblems(parsingProblem, problems);
     }
@@ -2009,6 +2048,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see     NameTypeDesignation
      * @see     SpecimenTypeDesignation
      */
+    @Override
     public Set<TypeDesignationBase> getTypeDesignations() {
         if(typeDesignations == null) {
             this.typeDesignations = new HashSet<TypeDesignationBase>();
@@ -2022,6 +2062,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      *
      * @param  typeDesignation  the type designation which should be deleted
      */
+    @Override
     @SuppressWarnings("deprecation")
     public void removeTypeDesignation(TypeDesignationBase typeDesignation) {
         this.typeDesignations.remove(typeDesignation);
@@ -2041,6 +2082,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see     NameTypeDesignation
      * @see     HomotypicalGroup
      */
+    @Override
     @Transient
     public Set<SpecimenTypeDesignation> getSpecimenTypeDesignationsOfHomotypicalGroup() {
         return this.getHomotypicalGroup().getSpecimenTypeDesignations();
@@ -2058,6 +2100,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see     NameTypeDesignation
      * @see     SpecimenTypeDesignation
      */
+    @Override
     @Transient
     public Set<NameTypeDesignation> getNameTypeDesignations() {
         Set<NameTypeDesignation> result = new HashSet<NameTypeDesignation>();
@@ -2088,6 +2131,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see                                                    NameTypeDesignation
      * @see                                                    TypeDesignationBase#isNotDesignated()
      */
+    @Override
     public NameTypeDesignation addNameTypeDesignation(TaxonNameBase typeSpecies,
                 Reference citation,
                 String citationMicroReference,
@@ -2120,6 +2164,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see                                                    NameTypeDesignation
      * @see                                                    TypeDesignationBase#isNotDesignated()
      */
+    @Override
     public NameTypeDesignation addNameTypeDesignation(TaxonNameBase typeSpecies,
                 Reference citation,
                 String citationMicroReference,
@@ -2137,6 +2182,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * Returns the set of {@link SpecimenTypeDesignation specimen type designations}
      * that typify <i>this</i> taxon name.
      */
+    @Override
     @Transient
     public Set<SpecimenTypeDesignation> getSpecimenTypeDesignations() {
         Set<SpecimenTypeDesignation> result = new HashSet<SpecimenTypeDesignation>();
@@ -2168,6 +2214,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see                                                    SpecimenTypeDesignation
      * @see                                                    TypeDesignationBase#isNotDesignated()
      */
+    @Override
     public SpecimenTypeDesignation addSpecimenTypeDesignation(DerivedUnit typeSpecimen,
                 SpecimenTypeDesignationStatus status,
                 Reference citation,
@@ -2198,6 +2245,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      *                                                                         is thrown. We do this to prevent a type designation to be used for multiple taxon names.
      *
      */
+    @Override
     public boolean addTypeDesignation(TypeDesignationBase typeDesignation, boolean addToAllNames){
         //currently typeDesignations are not persisted with the homotypical group
         //so explicit adding to the homotypical group is not necessary.
@@ -2247,6 +2295,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see    HomotypicalGroup
      */
 
+    @Override
     public HomotypicalGroup getHomotypicalGroup() {
         if (homotypicalGroup == null){
             homotypicalGroup = new HomotypicalGroup();
@@ -2258,6 +2307,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
     /**
      * @see #getHomotypicalGroup()
      */
+    @Override
     public void setHomotypicalGroup(HomotypicalGroup homotypicalGroup) {
         if (homotypicalGroup == null){
             throw new IllegalArgumentException("HomotypicalGroup of name should never be null but was set to 'null'");
@@ -2285,6 +2335,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see            #getNomenclaturalReference()
      * @see            #getNomenclaturalMicroReference()
      */
+    @Override
     @Transient
     public String getCitationString(){
         return getNomenclaturalReference().getNomenclaturalCitation(getNomenclaturalMicroReference());
@@ -2307,6 +2358,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @return  the string containing the publication date of <i>this</i> taxon name
      * @see            eu.etaxonomy.cdm.model.reference.INomenclaturalReference#getYear()
      */
+    @Override
     @Transient
     @ValidTaxonomicYear(groups=Level3.class)
     public String getReferenceYear(){
@@ -2328,6 +2380,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see    #getTaxa()
      * @see    #getSynonyms()
      */
+    @Override
     public Set<TaxonBase> getTaxonBases() {
         if(taxonBases == null) {
             this.taxonBases = new HashSet<TaxonBase>();
@@ -2344,6 +2397,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see                      #removeTaxonBase(TaxonBase)
      */
     //TODO protected
+    @Override
     public void addTaxonBase(TaxonBase taxonBase){
         Method method = ReflectionUtils.findMethod(TaxonBase.class, "setName", new Class[] {TaxonNameBase.class});
         ReflectionUtils.makeAccessible(method);
@@ -2357,6 +2411,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see                                    #getTaxonBases()
      * @see                                    #addTaxonBase(TaxonBase)
      */
+    @Override
     public void removeTaxonBase(TaxonBase taxonBase){
         Method method = ReflectionUtils.findMethod(TaxonBase.class, "setName", new Class[] {TaxonNameBase.class});
         ReflectionUtils.makeAccessible(method);
@@ -2374,6 +2429,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see    #getTaxonBases()
      * @see    #getSynonyms()
      */
+    @Override
     @Transient
     public Set<Taxon> getTaxa(){
         Set<Taxon> result = new HashSet<Taxon>();
@@ -2394,6 +2450,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see    #getTaxonBases()
      * @see    #getTaxa()
      */
+    @Override
     @Transient
     public Set<Synonym> getSynonyms() {
         Set<Synonym> result = new HashSet<Synonym>();
@@ -2504,6 +2561,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see    #removeDescription(TaxonNameDescription)
      * @see    eu.etaxonomy.cdm.model.description.TaxonNameDescription
      */
+    @Override
     public Set<TaxonNameDescription> getDescriptions() {
         return descriptions;
     }
@@ -2518,6 +2576,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see                                    #getDescriptions()
      * @see                            #removeDescription(TaxonNameDescription)
      */
+    @Override
     public void addDescription(TaxonNameDescription description) {
         java.lang.reflect.Field field = ReflectionUtils.findField(TaxonNameDescription.class, "taxonName", TaxonNameBase.class);
         ReflectionUtils.makeAccessible(field);
@@ -2534,6 +2593,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see                            #addDescription(TaxonNameDescription)
      * @see                            eu.etaxonomy.cdm.model.description.TaxonNameDescription#getTaxonName()
      */
+    @Override
     public void removeDescription(TaxonNameDescription description) {
         java.lang.reflect.Field field = ReflectionUtils.findField(TaxonNameDescription.class, "taxonName", TaxonNameBase.class);
         ReflectionUtils.makeAccessible(field);
@@ -2543,6 +2603,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
 
 // *********** HOMOTYPIC GROUP METHODS **************************************************
 
+    @Override
     @Transient
     public void mergeHomotypicGroups(TaxonNameBase name){
         this.getHomotypicalGroup().merge(name.getHomotypicalGroup());
@@ -2560,6 +2621,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @return                            the boolean value of the check
      * @see                               HomotypicalGroup
      */
+    @Override
     @Transient
     public boolean isHomotypic(TaxonNameBase homoTypicName) {
         if (homoTypicName == null) {
@@ -2583,6 +2645,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @param name
      * @return
      */
+    @Override
     @Transient
     public boolean isGroupsBasionym() {
        if (homotypicalGroup == null){
@@ -2615,6 +2678,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @param toName
      * @return
      */
+    @Override
     @Transient
     public boolean isBasionymFor(TaxonNameBase newCombinationName) {
             Set<NameRelationship> relations = newCombinationName.getRelationsToThisName();
@@ -2633,6 +2697,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      *
      * @see HomotypicalGroup.setGroupBasionym(TaxonNameBase basionymName)
      */
+    @Override
     @Transient
     public void makeGroupsBasionym() {
         this.homotypicalGroup.setGroupBasionym(this);
@@ -2651,6 +2716,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see  #isSpecies()
      * @see  #isInfraSpecific()
      */
+    @Override
     @Transient
     public boolean isSupraGeneric() {
         if (rank == null){
@@ -2668,6 +2734,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see  #isSpecies()
      * @see  #isInfraSpecific()
      */
+    @Override
     @Transient
     public boolean isGenus() {
         if (rank == null){
@@ -2686,6 +2753,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see  #isSpecies()
      * @see  #isInfraSpecific()
      */
+    @Override
     @Transient
     public boolean isInfraGeneric() {
         if (rank == null){
@@ -2704,6 +2772,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see  #isSpecies()
      * @see  #isInfraSpecific()
      */
+    @Override
     @Transient
     public boolean isSupraSpecific(){
         if (rank == null) {
@@ -2723,6 +2792,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see  #isInfraGeneric()
      * @see  #isInfraSpecific()
      */
+    @Override
     @Transient
     public boolean isSpecies() {
         if (rank == null){
@@ -2741,6 +2811,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see  #isInfraGeneric()
      * @see  #isSpecies()
      */
+    @Override
     @Transient
     public boolean isInfraSpecific() {
         if (rank == null){
@@ -2758,6 +2829,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      *
      * @return
      */
+    @Override
     @Transient
     public boolean isSpeciesAggregate() {
         if (rank == null){
@@ -2780,6 +2852,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      * @see    #isCodeCompliant()
      * @see    #getHasProblem()
      */
+    @Override
     public NomenclaturalCode getNomenclaturalCode() {
         logger.warn("TaxonNameBase has no specific Code defined. Use subclasses");
         return null;
@@ -2808,6 +2881,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      *
      * @param basionymName
      */
+    @Override
     @Transient
     public void setAsGroupsBasionym() {
 
@@ -2865,6 +2939,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
      *
      * @param basionymName
      */
+    @Override
     @Transient
     public void removeAsGroupsBasionym() {