2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.cdm
.model
.name
;
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
;
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
;
27 import eu
.etaxonomy
.cdm
.strategy
.cache
.name
.BacterialNameDefaultCacheStrategy
;
30 * The taxon name class for bacteria.
32 * This class corresponds to: NameBacterial according to the ABCD schema.
36 * @created 08-Nov-2007 13:06:11
38 @XmlAccessorType(XmlAccessType
.FIELD
)
39 @XmlType(name
= "", propOrder
= {
43 @XmlRootElement(name
= "BacterialName")
45 @Indexed(index
= "eu.etaxonomy.cdm.model.name.TaxonNameBase")
48 public class BacterialName
extends NonViralName
<BacterialName
> implements Cloneable
{
49 private static final long serialVersionUID
= -7641841279209976443L;
50 @SuppressWarnings("unused")
51 private static final Logger logger
= Logger
.getLogger(BacterialName
.class);
53 //Author team and year of the subgenus name
54 @XmlElement(name
= "SubGenusAuthorship")
55 @Field(index
=Index
.TOKENIZED
)
56 private String subGenusAuthorship
;
58 //Approbation of name according to approved list, validation list, or validly published, paper in IJSB after 1980
59 @XmlElement(name
= "NameApprobation")
60 @Field(index
=Index
.TOKENIZED
)
61 private String nameApprobation
;
63 // ************* CONSTRUCTORS *************/
65 protected BacterialName(){
67 this.cacheStrategy
= BacterialNameDefaultCacheStrategy
.NewInstance();
71 * Class constructor: creates a new bacterial taxon name instance
72 * only containing its {@link Rank rank},
73 * its {@link HomotypicalGroup homotypical group} and
74 * the {@link eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy default cache strategy}.
75 * The new bacterial taxon name instance will be also added to the set of
76 * bacterial taxon names belonging to this homotypical group.
78 * @param rank the rank to be assigned to <i>this</i> bacterial taxon name
79 * @param homotypicalGroup the homotypical group to which <i>this</i> bacterial taxon name belongs
80 * @see #NewInstance(Rank)
81 * @see #NewInstance(Rank, HomotypicalGroup)
82 * @see eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy
83 * @see eu.etaxonomy.cdm.strategy.cache.name.INameCacheStrategy
84 * @see eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy
86 protected BacterialName(Rank rank
, HomotypicalGroup homotypicalGroup
) {
87 super(rank
, homotypicalGroup
);
88 this.cacheStrategy
= BacterialNameDefaultCacheStrategy
.NewInstance();
91 //********* METHODS **************************************/
93 * Creates a new bacterial taxon name instance
94 * only containing its {@link Rank rank} and
95 * the {@link eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy default cache strategy}.
97 * @param rank the rank to be assigned to <i>this</i> bacterial taxon name
98 * @see #NewInstance(Rank, HomotypicalGroup)
99 * @see #BacterialName(Rank, HomotypicalGroup)
100 * @see eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy
101 * @see eu.etaxonomy.cdm.strategy.cache.name.INameCacheStrategy
102 * @see eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy
104 public static BacterialName
NewInstance(Rank rank
){
105 return new BacterialName(rank
, null);
109 * Creates a new bacterial taxon name instance
110 * only containing its {@link Rank rank},
111 * its {@link HomotypicalGroup homotypical group} and
112 * the {@link eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy default cache strategy}.
113 * The new bacterial taxon name instance will be also added to the set of
114 * bacterial taxon names belonging to this homotypical group.
116 * @param rank the rank to be assigned to <i>this</i> bacterial taxon name
117 * @param homotypicalGroup the homotypical group to which <i>this</i> bacterial taxon name belongs
118 * @see #NewInstance(Rank)
119 * @see #BacterialName(Rank, HomotypicalGroup)
120 * @see eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy
121 * @see eu.etaxonomy.cdm.strategy.cache.name.INameCacheStrategy
122 * @see eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy
124 public static BacterialName
NewInstance(Rank rank
, HomotypicalGroup homotypicalGroup
){
125 return new BacterialName(rank
, homotypicalGroup
);
129 * Returns the string containing the authorship with the year and details
130 * of the reference in which the subgenus included in the scientific name
131 * of <i>this</i> bacterial taxon name was published.
132 * For instance if the bacterial taxon name is
133 * 'Bacillus (subgen. Aerobacillus Donker 1926, 128) polymyxa' the subgenus
134 * authorship string is 'Donker 1926, 128'.
136 * @return the string containing the complete subgenus' authorship
137 * included in <i>this</i> bacterial taxon name
139 public String
getSubGenusAuthorship(){
140 return this.subGenusAuthorship
;
144 * @see #getSubGenusAuthorship()
146 public void setSubGenusAuthorship(String subGenusAuthorship
){
147 this.subGenusAuthorship
= subGenusAuthorship
;
151 * Returns the string representing the reason for the approbation of <i>this</i>
152 * bacterial taxon name. Bacterial taxon names are valid or approved
155 * <li>the approved list, c.f.r. IJSB 1980 (AL)
156 * <li>the validation list, in IJSB after 1980 (VL)
160 * <li>are validly published as paper in IJSB after 1980 (VP).
162 * IJSB is the acronym for International Journal of Systematic Bacteriology.
164 * @return the string with the source of the approbation for <i>this</i> bacterial taxon name
166 public String
getNameApprobation(){
167 return this.nameApprobation
;
171 * @see #getNameApprobation()
173 public void setNameApprobation(String nameApprobation
){
174 this.nameApprobation
= nameApprobation
;
179 * Returns the {@link NomenclaturalCode nomenclatural code} that governs
180 * the construction of <i>this</i> bacterial taxon name, that is the
181 * International Code of Nomenclature of Bacteria. This method overrides
182 * the getNomeclaturalCode method from {@link NonViralName NonViralName}.
184 * @return the nomenclatural code for bacteria
185 * @see NonViralName#isCodeCompliant()
186 * @see TaxonNameBase#getHasProblem()
189 public NomenclaturalCode
getNomenclaturalCode(){
190 return NomenclaturalCode
.ICNB
;
194 //*********************** CLONE ********************************************************/
197 * Clones <i>this</i> bacterial name. This is a shortcut that enables to create
198 * a new instance that differs only slightly from <i>this</i> bacterial name by
199 * modifying only some of the attributes.
201 * @see eu.etaxonomy.cdm.model.name.NonViralName#clone()
202 * @see java.lang.Object#clone()
205 public Object
clone() {
206 BacterialName result
= (BacterialName
)super.clone();
207 //no changes to: subGenusAuthorship, nameApprobation