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 eu
.etaxonomy
.cdm
.model
.common
.ReferencedEntityBase
;
14 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
16 import org
.apache
.log4j
.Logger
;
17 import org
.hibernate
.annotations
.Cascade
;
18 import org
.hibernate
.annotations
.CascadeType
;
19 import javax
.persistence
.*;
20 import javax
.xml
.bind
.annotation
.XmlAccessType
;
21 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
22 import javax
.xml
.bind
.annotation
.XmlType
;
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 * (or 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 TaxonNameBase typeSpecies
;
50 private TaxonNameBase typifiedName
;
52 // ************* CONSTRUCTORS *************/
54 * Class constructor: creates a new empty name type designation.
56 * @see #NameTypeDesignation(TaxonNameBase, TaxonNameBase, ReferenceBase, String, String, boolean, boolean)
58 protected NameTypeDesignation() {
63 * Class constructor: creates a new name type designation instance
64 * (including its {@link reference.ReferenceBase reference source} and eventually
65 * the taxon name string originally used by this reference when establishing
66 * the former designation) and adds it to the corresponding
67 * {@link TaxonNameBase#getNameTypeDesignations() name type designation set} of the typified name.
68 * The typified name will be added to the {@link HomotypicalGroup homotypical group} to which
69 * the species taxon name used for the typification belongs.
71 * @param typifiedName the suprageneric taxon name to be typified
72 * @param typeSpecies the species taxon name typifying the suprageneric taxon name
73 * @param citation the reference source for the new designation
74 * @param citationMicroReference the string with the details describing the exact localisation within the reference
75 * @param originalNameString the taxon name string used originally in the reference source for the new designation
76 * @param isRejectedType the boolean flag indicating whether the competent authorities rejected
77 * this name type designation
78 * @param isConservedType the boolean flag indicating whether the competent authorities conserved
79 * this name type designation
80 * @see #NameTypeDesignation()
81 * @see TaxonNameBase#addNameTypeDesignation(TaxonNameBase, ReferenceBase, String, String, boolean, boolean)
83 protected NameTypeDesignation(TaxonNameBase typifiedName
, TaxonNameBase typeSpecies
, ReferenceBase citation
, String citationMicroReference
,
84 String originalNameString
, boolean isRejectedType
, boolean isConservedType
) {
85 super(citation
, citationMicroReference
, originalNameString
);
86 this.setTypeSpecies(typeSpecies
);
87 this.setTypifiedName(typifiedName
);
88 typifiedName
.setHomotypicalGroup(typeSpecies
.getHomotypicalGroup());
89 this.isRejectedType
= isRejectedType
;
90 this.isConservedType
= isConservedType
;
93 //********* METHODS **************************************/
96 * Returns the {@link TaxonNameBase taxon name} that plays the role of the
97 * typified taxon name in this taxon name type designation. The {@link Rank rank}
98 * of a taxon name typified by another taxon name must be higher than
99 * "species aggregate".
101 * @see #getTypeSpecies()
103 @Cascade({CascadeType
.SAVE_UPDATE
})
104 public TaxonNameBase
getTypifiedName() {
108 * @see #getTypifiedName()
110 private void setTypifiedName(TaxonNameBase typifiedName
) {
111 this.typifiedName
= typifiedName
;
112 if (typifiedName
!= null){
113 typifiedName
.getNameTypeDesignations().add(this);
119 * Returns the {@link TaxonNameBase taxon name} that plays the role of the
120 * taxon name type in this taxon name type designation. The {@link Rank rank}
121 * of a taxon name type must be "species".
123 * @see #getTypifiedName()
126 @Cascade({CascadeType
.SAVE_UPDATE
})
127 public TaxonNameBase
getTypeSpecies(){
128 return this.typeSpecies
;
131 * @see #getTypeSpecies()
133 private void setTypeSpecies(TaxonNameBase typeSpecies
){
134 this.typeSpecies
= typeSpecies
;
138 * Returns the boolean value "true" if the competent authorities decided to
139 * reject the use of the species taxon name for this taxon name type
142 * @see #isConservedType()
144 public boolean isRejectedType(){
145 return this.isRejectedType
;
148 * @see #isRejectedType()
150 public void setRejectedType(boolean isRejectedType
){
151 this.isRejectedType
= isRejectedType
;
155 * Returns the boolean value "true" if the competent authorities decided to
156 * conserve the use of the species taxon name for this taxon name type
159 * @see #isConservedType()
161 public boolean isConservedType(){
162 return this.isConservedType
;
165 * @see #isConservedType()
167 public void setConservedType(boolean isConservedType
){
168 this.isConservedType
= isConservedType
;