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 java
.util
.HashSet
;
16 import javax
.persistence
.Entity
;
17 import javax
.persistence
.ManyToMany
;
18 import javax
.persistence
.ManyToOne
;
19 import javax
.persistence
.Transient
;
20 import javax
.xml
.bind
.annotation
.XmlElement
;
21 import javax
.xml
.bind
.annotation
.XmlElementWrapper
;
22 import javax
.xml
.bind
.annotation
.XmlIDREF
;
23 import javax
.xml
.bind
.annotation
.XmlSchemaType
;
24 import javax
.xml
.bind
.annotation
.XmlType
;
26 import org
.apache
.log4j
.Logger
;
27 import org
.hibernate
.annotations
.Cascade
;
28 import org
.hibernate
.annotations
.CascadeType
;
30 import eu
.etaxonomy
.cdm
.model
.common
.ReferencedEntityBase
;
31 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
34 * The class representing a typification of the {@link TaxonNameBase taxon names}, belonging
35 * to an {@link HomotypicalGroup homotypical group}, with a {@link Rank rank} above "species aggregate"
36 * by a species taxon name of the same homotypical group.<BR>
37 * According to nomenclature a type of a genus name or of any subdivision of a
38 * genus can only be a species name. A type of a family name or of any
39 * subdivision of a family is a genus name (and resolving it: a species name
40 * typifying this genus).<BR>
41 * Moreover the designation of a particular species name as a type for an
42 * homotypical group name might be nomenclaturally rejected or conserved.
43 * Depending on the date of publication, the same typification could be rejected
44 * according to one reference and later be conserved according to another
45 * reference, but a name type designation cannot be simultaneously rejected and
48 * @see SpecimenTypeDesignation
51 * @created 08-Nov-2007 13:06:38
53 @XmlType(name
="NameTypeDesignation")
55 public class NameTypeDesignation
extends TypeDesignationBase
implements ITypeDesignation
{
56 static Logger logger
= Logger
.getLogger(NameTypeDesignation
.class);
57 private boolean isRejectedType
;
58 private boolean isConservedType
;
59 private boolean isLectoType
;
60 private boolean isNotDesignated
;
61 private TaxonNameBase typeSpecies
;
63 // @XmlElement(name = "HomotypicalGroup")
65 // @XmlSchemaType(name = "IDREF")
66 // private HomotypicalGroup homotypicalGroup;
70 // ************* CONSTRUCTORS *************/
72 * Class constructor: creates a new empty name type designation.
74 * @see #NameTypeDesignation(TaxonNameBase, ReferenceBase, String, ReferenceBase, String, String, boolean, boolean, boolean)
76 protected NameTypeDesignation() {
81 * Class constructor: creates a new name type designation instance
82 * (including its {@link reference.ReferenceBase reference source} and eventually
83 * the taxon name string originally used by this reference when establishing
84 * the former designation) and adds it to the corresponding
85 * {@link TaxonNameBase#getNameTypeDesignations() name type designation set} of the typified name.
86 * The typified name will be added to the {@link HomotypicalGroup homotypical group} to which
87 * the species taxon name used for the typification belongs.
89 * @param typifiedName the suprageneric taxon name to be typified
90 * @param typeSpecies the species taxon name typifying the suprageneric taxon name
91 * @param citation the reference source for the new designation
92 * @param citationMicroReference the string with the details describing the exact localisation within the reference
93 * @param originalNameString the taxon name string used originally in the reference source for the new designation
94 * @param isRejectedType the boolean flag indicating whether the competent authorities rejected
95 * <i>this</i> name type designation
96 * @param isConservedType the boolean flag indicating whether the competent authorities conserved
97 * <i>this</i> name type designation
98 * @param isNotDesignated see at {@link #isNotDesignated()}
99 * @see #NameTypeDesignation()
100 * @see TaxonNameBase#addNameTypeDesignation(TaxonNameBase, ReferenceBase, String, String, boolean, boolean)
102 protected NameTypeDesignation(TaxonNameBase typeSpecies
, ReferenceBase citation
, String citationMicroReference
,
103 String originalNameString
, boolean isRejectedType
, boolean isConservedType
, boolean isNotDesignated
) {
104 super(citation
, citationMicroReference
, originalNameString
);
105 this.setTypeSpecies(typeSpecies
);
106 this.isRejectedType
= isRejectedType
;
107 this.isConservedType
= isConservedType
;
108 this.isNotDesignated
= isNotDesignated
;
111 //********* METHODS **************************************/
115 * Returns the {@link TaxonNameBase taxon name} that plays the role of the
116 * taxon name type in <i>this</i> taxon name type designation. The {@link Rank rank}
117 * of a taxon name type must be "species".
119 * @see #getTypifiedName()
122 @Cascade({CascadeType
.SAVE_UPDATE
})
123 public TaxonNameBase
getTypeSpecies(){
124 return this.typeSpecies
;
127 * @see #getTypeSpecies()
129 private void setTypeSpecies(TaxonNameBase typeSpecies
){
130 this.typeSpecies
= typeSpecies
;
134 * Returns the boolean value "true" if the competent authorities decided to
135 * reject the use of the species taxon name for <i>this</i> taxon name type
138 * @see #isConservedType()
140 public boolean isRejectedType(){
141 return this.isRejectedType
;
144 * @see #isRejectedType()
146 public void setRejectedType(boolean isRejectedType
){
147 this.isRejectedType
= isRejectedType
;
151 * Returns the boolean value "true" if the competent authorities decided to
152 * conserve the use of the species taxon name for <i>this</i> taxon name type
155 * @see #isRejectedType()
157 public boolean isConservedType(){
158 return this.isConservedType
;
161 * @see #isConservedType()
163 public void setConservedType(boolean isConservedType
){
164 this.isConservedType
= isConservedType
;
168 * Returns the boolean value "true" if the use of the species {@link TaxonNameBase taxon name} for
169 * <i>this</i> taxon name type designation was posterior to the publication of the
170 * typified taxon name. In this case the taxon name type designation should
171 * have a {@link reference.ReferenceBase reference} that is different to the
172 * nomenclatural reference of the typified taxon name.
174 * @see #getLectoTypeReference()
177 * @see eu.etaxonomy.cdm.model.name.ITypeDesignation#isLectoType()
179 public boolean isLectoType() {
184 * @see #isLectoType()
186 public void setLectoType(boolean isLectoType
) {
187 this.isLectoType
= isLectoType
;
191 * Returns the boolean value "true" if a name type does not exist.
192 * Two cases must be differentiated: <BR><ul>
193 * <li> a) it is unknown whether a name type exists and <BR>
194 * <li> b) it is known that no name type exists <BR>
196 * If b) is true there should be a NameTypeDesignation with the flag
197 * isNotDesignated set. The typeSpecies should then be "null".
199 public boolean isNotDesignated() {
200 return isNotDesignated
;
204 * @see #isNotDesignated()
206 public void setNotDesignated(boolean isNotDesignated
) {
207 this.isNotDesignated
= isNotDesignated
;