Merging cdmlib-model; pesi. Merge rev 8256:8526.
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / name / BacterialName.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9
10 package eu.etaxonomy.cdm.model.name;
11
12
13 import javax.persistence.Entity;
14 import javax.xml.bind.annotation.XmlAccessType;
15 import javax.xml.bind.annotation.XmlAccessorType;
16 import javax.xml.bind.annotation.XmlElement;
17 import javax.xml.bind.annotation.XmlRootElement;
18 import javax.xml.bind.annotation.XmlType;
19
20 import org.apache.log4j.Logger;
21 import org.hibernate.envers.Audited;
22 import org.hibernate.search.annotations.Field;
23 import org.hibernate.search.annotations.Index;
24 import org.hibernate.search.annotations.Indexed;
25 import org.springframework.beans.factory.annotation.Configurable;
26
27 import eu.etaxonomy.cdm.strategy.cache.name.BacterialNameDefaultCacheStrategy;
28 import eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy;
29
30 /**
31 * The taxon name class for bacteria.
32 * <P>
33 * This class corresponds to: NameBacterial according to the ABCD schema.
34 *
35 * @author m.doering
36 * @version 1.0
37 * @created 08-Nov-2007 13:06:11
38 */
39 @XmlAccessorType(XmlAccessType.FIELD)
40 @XmlType(name = "", propOrder = {
41 "subGenusAuthorship",
42 "nameApprobation"
43 })
44 @XmlRootElement(name = "BacterialName")
45 @Entity
46 @Indexed(index = "eu.etaxonomy.cdm.model.name.TaxonNameBase")
47 @Audited
48 @Configurable
49 public class BacterialName extends NonViralName<BacterialName> {
50 private static final long serialVersionUID = -7641841279209976443L;
51 @SuppressWarnings("unused")
52 private static final Logger logger = Logger.getLogger(BacterialName.class);
53
54 //Author team and year of the subgenus name
55 @XmlElement(name = "SubGenusAuthorship")
56 @Field(index=Index.TOKENIZED)
57 private String subGenusAuthorship;
58
59 //Approbation of name according to approved list, validation list, or validly published, paper in IJSB after 1980
60 @XmlElement(name = "NameApprobation")
61 @Field(index=Index.TOKENIZED)
62 private String nameApprobation;
63
64 // ************* CONSTRUCTORS *************/
65
66 protected BacterialName(){
67 super();
68 this.cacheStrategy = BacterialNameDefaultCacheStrategy.NewInstance();
69 }
70
71 /**
72 * Class constructor: creates a new bacterial taxon name instance
73 * only containing its {@link Rank rank},
74 * its {@link HomotypicalGroup homotypical group} and
75 * the {@link eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy default cache strategy}.
76 * The new bacterial taxon name instance will be also added to the set of
77 * bacterial taxon names belonging to this homotypical group.
78 *
79 * @param rank the rank to be assigned to <i>this</i> bacterial taxon name
80 * @param homotypicalGroup the homotypical group to which <i>this</i> bacterial taxon name belongs
81 * @see #NewInstance(Rank)
82 * @see #NewInstance(Rank, HomotypicalGroup)
83 * @see eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy
84 * @see eu.etaxonomy.cdm.strategy.cache.name.INameCacheStrategy
85 * @see eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy
86 */
87 protected BacterialName(Rank rank, HomotypicalGroup homotypicalGroup) {
88 super(rank, homotypicalGroup);
89 this.cacheStrategy = BacterialNameDefaultCacheStrategy.NewInstance();
90 }
91
92 //********* METHODS **************************************/
93 /**
94 * Creates a new bacterial taxon name instance
95 * only containing its {@link Rank rank} and
96 * the {@link eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy default cache strategy}.
97 *
98 * @param rank the rank to be assigned to <i>this</i> bacterial taxon name
99 * @see #NewInstance(Rank, HomotypicalGroup)
100 * @see #BacterialName(Rank, HomotypicalGroup)
101 * @see eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy
102 * @see eu.etaxonomy.cdm.strategy.cache.name.INameCacheStrategy
103 * @see eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy
104 */
105 public static BacterialName NewInstance(Rank rank){
106 return new BacterialName(rank, null);
107 }
108
109 /**
110 * Creates a new bacterial taxon name instance
111 * only containing its {@link Rank rank},
112 * its {@link HomotypicalGroup homotypical group} and
113 * the {@link eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy default cache strategy}.
114 * The new bacterial taxon name instance will be also added to the set of
115 * bacterial taxon names belonging to this homotypical group.
116 *
117 * @param rank the rank to be assigned to <i>this</i> bacterial taxon name
118 * @param homotypicalGroup the homotypical group to which <i>this</i> bacterial taxon name belongs
119 * @see #NewInstance(Rank)
120 * @see #BacterialName(Rank, HomotypicalGroup)
121 * @see eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy
122 * @see eu.etaxonomy.cdm.strategy.cache.name.INameCacheStrategy
123 * @see eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy
124 */
125 public static BacterialName NewInstance(Rank rank, HomotypicalGroup homotypicalGroup){
126 return new BacterialName(rank, homotypicalGroup);
127 }
128
129 /**
130 * Returns the string containing the authorship with the year and details
131 * of the reference in which the subgenus included in the scientific name
132 * of <i>this</i> bacterial taxon name was published.
133 * For instance if the bacterial taxon name is
134 * 'Bacillus (subgen. Aerobacillus Donker 1926, 128) polymyxa' the subgenus
135 * authorship string is 'Donker 1926, 128'.
136 *
137 * @return the string containing the complete subgenus' authorship
138 * included in <i>this</i> bacterial taxon name
139 */
140 public String getSubGenusAuthorship(){
141 return this.subGenusAuthorship;
142 }
143
144 /**
145 * @see #getSubGenusAuthorship()
146 */
147 public void setSubGenusAuthorship(String subGenusAuthorship){
148 this.subGenusAuthorship = subGenusAuthorship;
149 }
150
151 /**
152 * Returns the string representing the reason for the approbation of <i>this</i>
153 * bacterial taxon name. Bacterial taxon names are valid or approved
154 * according to:
155 * <ul>
156 * <li>the approved list, c.f.r. IJSB 1980 (AL)
157 * <li>the validation list, in IJSB after 1980 (VL)
158 * </ul>
159 * or
160 * <ul>
161 * <li>are validly published as paper in IJSB after 1980 (VP).
162 * </ul>
163 * IJSB is the acronym for International Journal of Systematic Bacteriology.
164 *
165 * @return the string with the source of the approbation for <i>this</i> bacterial taxon name
166 */
167 public String getNameApprobation(){
168 return this.nameApprobation;
169 }
170
171 /**
172 * @see #getNameApprobation()
173 */
174 public void setNameApprobation(String nameApprobation){
175 this.nameApprobation = nameApprobation;
176 }
177
178
179 /**
180 * Returns the {@link NomenclaturalCode nomenclatural code} that governs
181 * the construction of <i>this</i> bacterial taxon name, that is the
182 * International Code of Nomenclature of Bacteria. This method overrides
183 * the getNomeclaturalCode method from {@link NonViralName NonViralName}.
184 *
185 * @return the nomenclatural code for bacteria
186 * @see NonViralName#isCodeCompliant()
187 * @see TaxonNameBase#getHasProblem()
188 */
189 @Override
190 public NomenclaturalCode getNomenclaturalCode(){
191 return NomenclaturalCode.ICNB;
192
193 }
194
195 }