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
.persistence
.ManyToOne
;
15 import javax
.xml
.bind
.annotation
.XmlType
;
17 import org
.apache
.log4j
.Logger
;
18 import org
.hibernate
.annotations
.Cascade
;
19 import org
.hibernate
.annotations
.CascadeType
;
21 import eu
.etaxonomy
.cdm
.model
.common
.ReferencedEntityBase
;
22 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
25 * The class representing a typification of a {@link TaxonNameBase taxon name} with
26 * a {@link Rank rank} above "species aggregate" by a species taxon name. A type of a
27 * genus name or of any subdivision of a genus can only be a species name.
28 * A type of a family name or of any subdivision of a family is a genus name
29 * (and resolving it: a species name typifying this genus).
30 * Moreover the designation of a particular species name as a type for a
31 * suprageneric taxon name might be nomenclaturally rejected or conserved.
32 * Depending on the date of publication, the same typification could be rejected
33 * according to one reference and later be conserved according to another
34 * reference, but a name type designation cannot be simultaneously rejected and
35 * conserved. Both names, the typified name and the species name used in
36 * the name type designation, must belong to the same {@link HomotypicalGroup homotypical group}.
38 * @see SpecimenTypeDesignation
41 * @created 08-Nov-2007 13:06:38
43 @XmlType(name
="NameTypeDesignation")
45 public class NameTypeDesignation
extends ReferencedEntityBase
{
46 static Logger logger
= Logger
.getLogger(NameTypeDesignation
.class);
47 private boolean isRejectedType
;
48 private boolean isConservedType
;
49 private boolean isLectoType
;
50 private ReferenceBase lectoTypeReference
;
51 private String lectoTypeMicroReference
;
52 private boolean isNotDesignated
;
53 private TaxonNameBase typeSpecies
;
54 private TaxonNameBase typifiedName
;
56 // ************* CONSTRUCTORS *************/
58 * Class constructor: creates a new empty name type designation.
60 * @see #NameTypeDesignation(TaxonNameBase, TaxonNameBase, ReferenceBase, String, String, boolean, boolean)
62 protected NameTypeDesignation() {
67 * Class constructor: creates a new name type designation instance
68 * (including its {@link reference.ReferenceBase reference source} and eventually
69 * the taxon name string originally used by this reference when establishing
70 * the former designation) and adds it to the corresponding
71 * {@link TaxonNameBase#getNameTypeDesignations() name type designation set} of the typified name.
72 * The typified name will be added to the {@link HomotypicalGroup homotypical group} to which
73 * the species taxon name used for the typification belongs.
75 * @param typifiedName the suprageneric taxon name to be typified
76 * @param typeSpecies the species taxon name typifying the suprageneric taxon name
77 * @param citation the reference source for the new designation
78 * @param citationMicroReference the string with the details describing the exact localisation within the reference
79 * @param originalNameString the taxon name string used originally in the reference source for the new designation
80 * @param isRejectedType the boolean flag indicating whether the competent authorities rejected
81 * this name type designation
82 * @param isConservedType the boolean flag indicating whether the competent authorities conserved
83 * this name type designation
84 * @param isNotDesignated see at {@link #isNotDesignated()}
85 * @see #NameTypeDesignation()
86 * @see TaxonNameBase#addNameTypeDesignation(TaxonNameBase, ReferenceBase, String, String, boolean, boolean)
88 protected NameTypeDesignation(TaxonNameBase typifiedName
, TaxonNameBase typeSpecies
, ReferenceBase citation
, String citationMicroReference
,
89 String originalNameString
, boolean isRejectedType
, boolean isConservedType
, boolean isNotDesignated
) {
90 super(citation
, citationMicroReference
, originalNameString
);
91 this.setTypeSpecies(typeSpecies
);
92 this.setTypifiedName(typifiedName
);
93 typifiedName
.setHomotypicalGroup(typeSpecies
.getHomotypicalGroup());
94 this.isRejectedType
= isRejectedType
;
95 this.isConservedType
= isConservedType
;
96 this.isNotDesignated
= isNotDesignated
;
99 //********* METHODS **************************************/
102 * Returns the {@link TaxonNameBase taxon name} that plays the role of the
103 * typified taxon name in this taxon name type designation. The {@link Rank rank}
104 * of a taxon name typified by another taxon name must be higher than
105 * "species aggregate".
107 * @see #getTypeSpecies()
110 @Cascade({CascadeType
.SAVE_UPDATE
})
111 public TaxonNameBase
getTypifiedName() {
115 * @see #getTypifiedName()
117 private void setTypifiedName(TaxonNameBase typifiedName
) {
118 this.typifiedName
= typifiedName
;
119 if (typifiedName
!= null){
120 typifiedName
.getNameTypeDesignations().add(this);
126 * Returns the {@link TaxonNameBase taxon name} that plays the role of the
127 * taxon name type in this taxon name type designation. The {@link Rank rank}
128 * of a taxon name type must be "species".
130 * @see #getTypifiedName()
133 @Cascade({CascadeType
.SAVE_UPDATE
})
134 public TaxonNameBase
getTypeSpecies(){
135 return this.typeSpecies
;
138 * @see #getTypeSpecies()
140 private void setTypeSpecies(TaxonNameBase typeSpecies
){
141 this.typeSpecies
= typeSpecies
;
145 * Returns the boolean value "true" if the competent authorities decided to
146 * reject the use of the species taxon name for this taxon name type
149 * @see #isConservedType()
151 public boolean isRejectedType(){
152 return this.isRejectedType
;
155 * @see #isRejectedType()
157 public void setRejectedType(boolean isRejectedType
){
158 this.isRejectedType
= isRejectedType
;
162 * Returns the boolean value "true" if the competent authorities decided to
163 * conserve the use of the species taxon name for this taxon name type
166 * @see #isConservedType()
168 public boolean isConservedType(){
169 return this.isConservedType
;
172 * @see #isConservedType()
174 public void setConservedType(boolean isConservedType
){
175 this.isConservedType
= isConservedType
;
179 * @return the isLectoType
181 public boolean isLectoType() {
186 * @param isLectoType the isLectoType to set
188 public void setLectoType(boolean isLectoType
) {
189 this.isLectoType
= isLectoType
;
193 * @return the lectoTypeReference
195 public ReferenceBase
getLectoTypeReference() {
196 return lectoTypeReference
;
200 * @param lectoTypeReference the lectoTypeReference to set
202 public void setLectoTypeReference(ReferenceBase lectoTypeReference
) {
203 this.lectoTypeReference
= lectoTypeReference
;
207 * @return the lectoTypeMicroReference
209 public String
getLectoTypeMicroReference() {
210 return lectoTypeMicroReference
;
214 * @param lectoTypeMicroReference the lectoTypeMicroReference to set
216 public void setLectoTypeMicroReference(String lectoTypeMicroReference
) {
217 this.lectoTypeMicroReference
= lectoTypeMicroReference
;
221 * If true this indicates that a name type does not exist.
222 * This is differentiate that <BR>
223 * a) it is unknown if a name type exists and <BR>
224 * b) it is known that no name type exists <BR>
225 * If b is true there should be a NameTypeDesignation with <code>isNotDesignate == true</code>
226 * The typeSpecies should be <code>null</code> then.
227 * @return the notDesignated
229 public boolean isNotDesignated() {
230 return isNotDesignated
;
234 * @param notDesignated the notDesignated to set
236 public void setNotDesignated(boolean isNotDesignated
) {
237 this.isNotDesignated
= isNotDesignated
;