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
;
12 import java
.util
.HashSet
;
15 import javax
.persistence
.Entity
;
16 import javax
.persistence
.FetchType
;
17 import javax
.persistence
.ManyToMany
;
18 import javax
.persistence
.ManyToOne
;
19 import javax
.persistence
.Transient
;
20 import javax
.xml
.bind
.annotation
.XmlAccessType
;
21 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
22 import javax
.xml
.bind
.annotation
.XmlElement
;
23 import javax
.xml
.bind
.annotation
.XmlElementWrapper
;
24 import javax
.xml
.bind
.annotation
.XmlIDREF
;
25 import javax
.xml
.bind
.annotation
.XmlRootElement
;
26 import javax
.xml
.bind
.annotation
.XmlSchemaType
;
27 import javax
.xml
.bind
.annotation
.XmlType
;
29 import org
.apache
.log4j
.Logger
;
30 import org
.hibernate
.annotations
.Cascade
;
31 import org
.hibernate
.annotations
.CascadeType
;
33 import eu
.etaxonomy
.cdm
.model
.common
.ReferencedEntityBase
;
34 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
37 * The class representing a typification of a {@link TaxonNameBase taxon name} with a {@link Rank rank}
38 * above "species aggregate" by another taxon name.<BR>
39 * According to nomenclature a type of a genus name or of any subdivision of a
40 * genus can only be a species name. A type of a family name or of any
41 * subdivision of a family is a genus name.<BR>
42 * Moreover the designation of a particular taxon name as a type might be
43 * nomenclaturally rejected or conserved. Depending on the date of publication,
44 * the same typification could be rejected according to one reference and later
45 * be conserved according to another reference, but a name type designation
46 * cannot be simultaneously rejected and conserved.<BR>
47 * Name type designations are treated as {@link TypeDesignationBase type designations}
48 * and not as {@link NameRelationship name relationships}.
50 * @see TypeDesignationBase
51 * @see SpecimenTypeDesignation
54 * @created 08-Nov-2007 13:06:38
56 @XmlRootElement(name
= "NameTypeDesignation")
57 @XmlAccessorType(XmlAccessType
.FIELD
)
58 @XmlType(name
= "NameTypeDesignation", propOrder
= {
66 public class NameTypeDesignation
extends TypeDesignationBase
implements ITypeDesignation
{
68 static Logger logger
= Logger
.getLogger(NameTypeDesignation
.class);
70 @XmlElement(name
= "IsRejectedType")
71 private boolean isRejectedType
;
73 @XmlElement(name
= "IsConservedType")
74 private boolean isConservedType
;
76 @XmlElement(name
= "IsLectoType")
77 private boolean isLectoType
;
79 @XmlElement(name
= "TypeName")
81 @XmlSchemaType(name
= "IDREF")
82 private TaxonNameBase typeName
;
84 // @XmlElement(name = "HomotypicalGroup")
86 // @XmlSchemaType(name = "IDREF")
87 // private HomotypicalGroup homotypicalGroup;
91 // ************* CONSTRUCTORS *************/
93 * Class constructor: creates a new empty name type designation.
95 * @see #NameTypeDesignation(TaxonNameBase, ReferenceBase, String, String, boolean, boolean, boolean)
97 protected NameTypeDesignation() {
102 * Class constructor: creates a new name type designation instance
103 * (including its {@link eu.etaxonomy.cdm.model.reference.ReferenceBase reference source} and eventually
104 * the taxon name string originally used by this reference when establishing
105 * the former designation).
107 * @param typeName the taxon name used as a type
108 * @param citation the reference source for the new designation
109 * @param citationMicroReference the string with the details describing the exact localisation within the reference
110 * @param originalNameString the taxon name string used originally in the reference source for the new designation
111 * @param isRejectedType the boolean flag indicating whether the competent authorities rejected
112 * <i>this</i> name type designation
113 * @param isConservedType the boolean flag indicating whether the competent authorities conserved
114 * <i>this</i> name type designation
115 * @param isNotDesignated the boolean flag indicating whether there is no name type at all for
116 * <i>this</i> name type designation
117 * @see #NameTypeDesignation()
118 * @see TypeDesignationBase#isNotDesignated()
119 * @see TaxonNameBase#addNameTypeDesignation(TaxonNameBase, ReferenceBase, String, String, boolean, boolean, boolean, boolean, boolean)
121 protected NameTypeDesignation(TaxonNameBase typeName
, ReferenceBase citation
, String citationMicroReference
,
122 String originalNameString
, boolean isRejectedType
, boolean isConservedType
, boolean isNotDesignated
) {
123 super(citation
, citationMicroReference
, originalNameString
, isNotDesignated
);
124 this.setTypeName(typeName
);
125 this.isRejectedType
= isRejectedType
;
126 this.isConservedType
= isConservedType
;
129 //********* METHODS **************************************/
133 * Returns the {@link TaxonNameBase taxon name} that plays the role of the
134 * taxon name type in <i>this</i> taxon name type designation. The {@link Rank rank}
135 * of the taxon name type must be "species".
137 @ManyToOne(fetch
= FetchType
.LAZY
)
138 @Cascade({CascadeType
.SAVE_UPDATE
})
139 public TaxonNameBase
getTypeName(){
140 return this.typeName
;
143 * @see #getTypeName()
145 private void setTypeName(TaxonNameBase typeName
){
146 this.typeName
= typeName
;
150 * Returns the boolean value "true" if the competent authorities decided to
151 * reject the use of the species taxon name as the type for <i>this</i> taxon
152 * name type designation.
154 * @see #isConservedType()
156 public boolean isRejectedType(){
157 return this.isRejectedType
;
160 * @see #isRejectedType()
162 public void setRejectedType(boolean isRejectedType
){
163 this.isRejectedType
= isRejectedType
;
167 * Returns the boolean value "true" if the competent authorities decided to
168 * conserve the use of the species taxon name as the type for <i>this</i> taxon
169 * name type designation.
171 * @see #isRejectedType()
173 public boolean isConservedType(){
174 return this.isConservedType
;
177 * @see #isConservedType()
179 public void setConservedType(boolean isConservedType
){
180 this.isConservedType
= isConservedType
;
184 * Returns the boolean value "true" if the use of the species {@link TaxonNameBase taxon name}
185 * as the type for <i>this</i> taxon name type designation was posterior to the
186 * publication of the typified taxon name. In this case the taxon name type
187 * designation should have a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase reference} that is different to the
188 * {@link TaxonNameBase#getNomenclaturalReference() nomenclatural reference} of the typified taxon name.
190 * @see ReferencedEntityBase#getCitation()
193 * @see eu.etaxonomy.cdm.model.name.ITypeDesignation#isLectoType()
195 public boolean isLectoType() {
200 * @see #isLectoType()
202 public void setLectoType(boolean isLectoType
) {
203 this.isLectoType
= isLectoType
;