X-Git-Url: https://dev.e-taxonomy.eu/gitweb/cdmlib.git/blobdiff_plain/ba787a0593d44b16570724228885d7b2c1a12b99..cccbf1207d34a3aef1ffce9a0b6c41c15c5feb69:/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/BacterialName.java
diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/BacterialName.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/BacterialName.java
index 2069409d3c..6b747bd77c 100644
--- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/BacterialName.java
+++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/BacterialName.java
@@ -1,8 +1,8 @@
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* 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.
*/
@@ -10,52 +10,201 @@
package eu.etaxonomy.cdm.model.name;
+import javax.persistence.Entity;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
import org.apache.log4j.Logger;
+import org.hibernate.envers.Audited;
+import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.Indexed;
+import org.springframework.beans.factory.annotation.Configurable;
-import javax.persistence.*;
+import eu.etaxonomy.cdm.strategy.cache.name.BacterialNameDefaultCacheStrategy;
/**
- * Taxon name class for bacteria
+ * The taxon name class for bacteria.
+ *
+ * This class corresponds to: NameBacterial according to the ABCD schema.
+ *
* @author m.doering
* @version 1.0
* @created 08-Nov-2007 13:06:11
*/
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+ "subGenusAuthorship",
+ "nameApprobation"
+})
+@XmlRootElement(name = "BacterialName")
@Entity
-public class BacterialName extends NonViralName {
- static Logger logger = Logger.getLogger(BacterialName.class);
+@Indexed(index = "eu.etaxonomy.cdm.model.name.TaxonNameBase")
+@Audited
+@Configurable
+public class BacterialName extends NonViralName implements Cloneable{
+ private static final long serialVersionUID = -7641841279209976443L;
+ @SuppressWarnings("unused")
+ private static final Logger logger = Logger.getLogger(BacterialName.class);
//Author team and year of the subgenus name
+ @XmlElement(name = "SubGenusAuthorship")
+ @Field
private String subGenusAuthorship;
- //Approbation of name according to approved list, validation list,or validly published, paper in IJSB after 1980
+
+ //Approbation of name according to approved list, validation list, or validly published, paper in IJSB after 1980
+ @XmlElement(name = "NameApprobation")
+ @Field
private String nameApprobation;
- public BacterialName(Rank rank) {
- super(rank);
+ // ************* CONSTRUCTORS *************/
+
+ protected BacterialName(){
+ super();
+ this.cacheStrategy = BacterialNameDefaultCacheStrategy.NewInstance();
+ }
+
+ /**
+ * Class constructor: creates a new bacterial taxon name instance
+ * only containing its {@link Rank rank},
+ * its {@link HomotypicalGroup homotypical group} and
+ * the {@link eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy default cache strategy}.
+ * The new bacterial taxon name instance will be also added to the set of
+ * bacterial taxon names belonging to this homotypical group.
+ *
+ * @param rank the rank to be assigned to this bacterial taxon name
+ * @param homotypicalGroup the homotypical group to which this bacterial taxon name belongs
+ * @see #NewInstance(Rank)
+ * @see #NewInstance(Rank, HomotypicalGroup)
+ * @see eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy
+ * @see eu.etaxonomy.cdm.strategy.cache.name.INameCacheStrategy
+ * @see eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy
+ */
+ protected BacterialName(Rank rank, HomotypicalGroup homotypicalGroup) {
+ super(rank, homotypicalGroup);
+ this.cacheStrategy = BacterialNameDefaultCacheStrategy.NewInstance();
+ }
+
+ //********* METHODS **************************************/
+ /**
+ * Creates a new bacterial taxon name instance
+ * only containing its {@link Rank rank} and
+ * the {@link eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy default cache strategy}.
+ *
+ * @param rank the rank to be assigned to this bacterial taxon name
+ * @see #NewInstance(Rank, HomotypicalGroup)
+ * @see #BacterialName(Rank, HomotypicalGroup)
+ * @see eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy
+ * @see eu.etaxonomy.cdm.strategy.cache.name.INameCacheStrategy
+ * @see eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy
+ */
+ public static BacterialName NewInstance(Rank rank){
+ return new BacterialName(rank, null);
+ }
+
+ /**
+ * Creates a new bacterial taxon name instance
+ * only containing its {@link Rank rank},
+ * its {@link HomotypicalGroup homotypical group} and
+ * the {@link eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy default cache strategy}.
+ * The new bacterial taxon name instance will be also added to the set of
+ * bacterial taxon names belonging to this homotypical group.
+ *
+ * @param rank the rank to be assigned to this bacterial taxon name
+ * @param homotypicalGroup the homotypical group to which this bacterial taxon name belongs
+ * @see #NewInstance(Rank)
+ * @see #BacterialName(Rank, HomotypicalGroup)
+ * @see eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy
+ * @see eu.etaxonomy.cdm.strategy.cache.name.INameCacheStrategy
+ * @see eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy
+ */
+ public static BacterialName NewInstance(Rank rank, HomotypicalGroup homotypicalGroup){
+ return new BacterialName(rank, homotypicalGroup);
}
-
+ /**
+ * Returns the string containing the authorship with the year and details
+ * of the reference in which the subgenus included in the scientific name
+ * of this bacterial taxon name was published.
+ * For instance if the bacterial taxon name is
+ * 'Bacillus (subgen. Aerobacillus Donker 1926, 128) polymyxa' the subgenus
+ * authorship string is 'Donker 1926, 128'.
+ *
+ * @return the string containing the complete subgenus' authorship
+ * included in this bacterial taxon name
+ */
public String getSubGenusAuthorship(){
return this.subGenusAuthorship;
}
/**
- *
- * @param subGenusAuthorship subGenusAuthorship
+ * @see #getSubGenusAuthorship()
*/
public void setSubGenusAuthorship(String subGenusAuthorship){
this.subGenusAuthorship = subGenusAuthorship;
}
+ /**
+ * Returns the string representing the reason for the approbation of this
+ * bacterial taxon name. Bacterial taxon names are valid or approved
+ * according to:
+ *
+ * - the approved list, c.f.r. IJSB 1980 (AL)
+ *
- the validation list, in IJSB after 1980 (VL)
+ *
+ * or
+ *
+ * - are validly published as paper in IJSB after 1980 (VP).
+ *
+ * IJSB is the acronym for International Journal of Systematic Bacteriology.
+ *
+ * @return the string with the source of the approbation for this bacterial taxon name
+ */
public String getNameApprobation(){
return this.nameApprobation;
}
/**
- *
- * @param nameApprobation nameApprobation
+ * @see #getNameApprobation()
*/
public void setNameApprobation(String nameApprobation){
this.nameApprobation = nameApprobation;
}
-}
\ No newline at end of file
+
+ /**
+ * Returns the {@link NomenclaturalCode nomenclatural code} that governs
+ * the construction of this bacterial taxon name, that is the
+ * International Code of Nomenclature of Bacteria. This method overrides
+ * the getNomeclaturalCode method from {@link NonViralName NonViralName}.
+ *
+ * @return the nomenclatural code for bacteria
+ * @see NonViralName#isCodeCompliant()
+ * @see TaxonNameBase#getHasProblem()
+ */
+ @Override
+ public NomenclaturalCode getNomenclaturalCode(){
+ return NomenclaturalCode.ICNB;
+
+ }
+
+//*********************** CLONE ********************************************************/
+
+ /**
+ * Clones this bacterial name. This is a shortcut that enables to create
+ * a new instance that differs only slightly from this bacterial name by
+ * modifying only some of the attributes.
+ *
+ * @see eu.etaxonomy.cdm.model.name.NonViralName#clone()
+ * @see java.lang.Object#clone()
+ */
+ @Override
+ public Object clone() {
+ BacterialName result = (BacterialName)super.clone();
+ //no changes to: subGenusAuthorship, nameApprobation
+ return result;
+ }
+
+}