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.Indexed;
|
24
|
import org.springframework.beans.factory.annotation.Configurable;
|
25
|
|
26
|
import eu.etaxonomy.cdm.strategy.cache.name.BacterialNameDefaultCacheStrategy;
|
27
|
|
28
|
/**
|
29
|
* The taxon name class for bacteria.
|
30
|
* <P>
|
31
|
* This class corresponds to: NameBacterial according to the ABCD schema.
|
32
|
*
|
33
|
* @author m.doering
|
34
|
* @version 1.0
|
35
|
* @created 08-Nov-2007 13:06:11
|
36
|
*/
|
37
|
@XmlAccessorType(XmlAccessType.FIELD)
|
38
|
@XmlType(name = "", propOrder = {
|
39
|
"subGenusAuthorship",
|
40
|
"nameApprobation"
|
41
|
})
|
42
|
@XmlRootElement(name = "BacterialName")
|
43
|
@Entity
|
44
|
@Indexed(index = "eu.etaxonomy.cdm.model.name.TaxonNameBase")
|
45
|
@Audited
|
46
|
@Configurable
|
47
|
public class BacterialName extends NonViralName<BacterialName> implements Cloneable{
|
48
|
private static final long serialVersionUID = -7641841279209976443L;
|
49
|
@SuppressWarnings("unused")
|
50
|
private static final Logger logger = Logger.getLogger(BacterialName.class);
|
51
|
|
52
|
//Author team and year of the subgenus name
|
53
|
@XmlElement(name = "SubGenusAuthorship")
|
54
|
@Field
|
55
|
private String subGenusAuthorship;
|
56
|
|
57
|
//Approbation of name according to approved list, validation list, or validly published, paper in IJSB after 1980
|
58
|
@XmlElement(name = "NameApprobation")
|
59
|
@Field
|
60
|
private String nameApprobation;
|
61
|
|
62
|
// ************* CONSTRUCTORS *************/
|
63
|
|
64
|
protected BacterialName(){
|
65
|
super();
|
66
|
this.cacheStrategy = BacterialNameDefaultCacheStrategy.NewInstance();
|
67
|
}
|
68
|
|
69
|
/**
|
70
|
* Class constructor: creates a new bacterial taxon name instance
|
71
|
* only containing its {@link Rank rank},
|
72
|
* its {@link HomotypicalGroup homotypical group} and
|
73
|
* the {@link eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy default cache strategy}.
|
74
|
* The new bacterial taxon name instance will be also added to the set of
|
75
|
* bacterial taxon names belonging to this homotypical group.
|
76
|
*
|
77
|
* @param rank the rank to be assigned to <i>this</i> bacterial taxon name
|
78
|
* @param homotypicalGroup the homotypical group to which <i>this</i> bacterial taxon name belongs
|
79
|
* @see #NewInstance(Rank)
|
80
|
* @see #NewInstance(Rank, HomotypicalGroup)
|
81
|
* @see eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy
|
82
|
* @see eu.etaxonomy.cdm.strategy.cache.name.INameCacheStrategy
|
83
|
* @see eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy
|
84
|
*/
|
85
|
protected BacterialName(Rank rank, HomotypicalGroup homotypicalGroup) {
|
86
|
super(rank, homotypicalGroup);
|
87
|
this.cacheStrategy = BacterialNameDefaultCacheStrategy.NewInstance();
|
88
|
}
|
89
|
|
90
|
//********* METHODS **************************************/
|
91
|
/**
|
92
|
* Creates a new bacterial taxon name instance
|
93
|
* only containing its {@link Rank rank} and
|
94
|
* the {@link eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy default cache strategy}.
|
95
|
*
|
96
|
* @param rank the rank to be assigned to <i>this</i> bacterial taxon name
|
97
|
* @see #NewInstance(Rank, HomotypicalGroup)
|
98
|
* @see #BacterialName(Rank, HomotypicalGroup)
|
99
|
* @see eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy
|
100
|
* @see eu.etaxonomy.cdm.strategy.cache.name.INameCacheStrategy
|
101
|
* @see eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy
|
102
|
*/
|
103
|
public static BacterialName NewInstance(Rank rank){
|
104
|
return new BacterialName(rank, null);
|
105
|
}
|
106
|
|
107
|
/**
|
108
|
* Creates a new bacterial taxon name instance
|
109
|
* only containing its {@link Rank rank},
|
110
|
* its {@link HomotypicalGroup homotypical group} and
|
111
|
* the {@link eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy default cache strategy}.
|
112
|
* The new bacterial taxon name instance will be also added to the set of
|
113
|
* bacterial taxon names belonging to this homotypical group.
|
114
|
*
|
115
|
* @param rank the rank to be assigned to <i>this</i> bacterial taxon name
|
116
|
* @param homotypicalGroup the homotypical group to which <i>this</i> bacterial taxon name belongs
|
117
|
* @see #NewInstance(Rank)
|
118
|
* @see #BacterialName(Rank, HomotypicalGroup)
|
119
|
* @see eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy
|
120
|
* @see eu.etaxonomy.cdm.strategy.cache.name.INameCacheStrategy
|
121
|
* @see eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy
|
122
|
*/
|
123
|
public static BacterialName NewInstance(Rank rank, HomotypicalGroup homotypicalGroup){
|
124
|
return new BacterialName(rank, homotypicalGroup);
|
125
|
}
|
126
|
|
127
|
/**
|
128
|
* Returns the string containing the authorship with the year and details
|
129
|
* of the reference in which the subgenus included in the scientific name
|
130
|
* of <i>this</i> bacterial taxon name was published.
|
131
|
* For instance if the bacterial taxon name is
|
132
|
* 'Bacillus (subgen. Aerobacillus Donker 1926, 128) polymyxa' the subgenus
|
133
|
* authorship string is 'Donker 1926, 128'.
|
134
|
*
|
135
|
* @return the string containing the complete subgenus' authorship
|
136
|
* included in <i>this</i> bacterial taxon name
|
137
|
*/
|
138
|
public String getSubGenusAuthorship(){
|
139
|
return this.subGenusAuthorship;
|
140
|
}
|
141
|
|
142
|
/**
|
143
|
* @see #getSubGenusAuthorship()
|
144
|
*/
|
145
|
public void setSubGenusAuthorship(String subGenusAuthorship){
|
146
|
this.subGenusAuthorship = subGenusAuthorship;
|
147
|
}
|
148
|
|
149
|
/**
|
150
|
* Returns the string representing the reason for the approbation of <i>this</i>
|
151
|
* bacterial taxon name. Bacterial taxon names are valid or approved
|
152
|
* according to:
|
153
|
* <ul>
|
154
|
* <li>the approved list, c.f.r. IJSB 1980 (AL)
|
155
|
* <li>the validation list, in IJSB after 1980 (VL)
|
156
|
* </ul>
|
157
|
* or
|
158
|
* <ul>
|
159
|
* <li>are validly published as paper in IJSB after 1980 (VP).
|
160
|
* </ul>
|
161
|
* IJSB is the acronym for International Journal of Systematic Bacteriology.
|
162
|
*
|
163
|
* @return the string with the source of the approbation for <i>this</i> bacterial taxon name
|
164
|
*/
|
165
|
public String getNameApprobation(){
|
166
|
return this.nameApprobation;
|
167
|
}
|
168
|
|
169
|
/**
|
170
|
* @see #getNameApprobation()
|
171
|
*/
|
172
|
public void setNameApprobation(String nameApprobation){
|
173
|
this.nameApprobation = nameApprobation;
|
174
|
}
|
175
|
|
176
|
|
177
|
/**
|
178
|
* Returns the {@link NomenclaturalCode nomenclatural code} that governs
|
179
|
* the construction of <i>this</i> bacterial taxon name, that is the
|
180
|
* International Code of Nomenclature of Bacteria. This method overrides
|
181
|
* the getNomenclaturalCode method from {@link NonViralName NonViralName}.
|
182
|
*
|
183
|
* @return the nomenclatural code for bacteria
|
184
|
* @see NonViralName#isCodeCompliant()
|
185
|
* @see TaxonNameBase#getHasProblem()
|
186
|
*/
|
187
|
@Override
|
188
|
public NomenclaturalCode getNomenclaturalCode(){
|
189
|
return NomenclaturalCode.ICNB;
|
190
|
|
191
|
}
|
192
|
|
193
|
//*********************** CLONE ********************************************************/
|
194
|
|
195
|
/**
|
196
|
* Clones <i>this</i> bacterial name. This is a shortcut that enables to create
|
197
|
* a new instance that differs only slightly from <i>this</i> bacterial name by
|
198
|
* modifying only some of the attributes.
|
199
|
*
|
200
|
* @see eu.etaxonomy.cdm.model.name.NonViralName#clone()
|
201
|
* @see java.lang.Object#clone()
|
202
|
*/
|
203
|
@Override
|
204
|
public Object clone() {
|
205
|
BacterialName result = (BacterialName)super.clone();
|
206
|
//no changes to: subGenusAuthorship, nameApprobation
|
207
|
return result;
|
208
|
}
|
209
|
|
210
|
}
|