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 javax
.persistence
.Entity
;
13 import javax
.persistence
.FetchType
;
14 import javax
.persistence
.ManyToOne
;
15 import javax
.xml
.bind
.annotation
.XmlAccessType
;
16 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
17 import javax
.xml
.bind
.annotation
.XmlElement
;
18 import javax
.xml
.bind
.annotation
.XmlIDREF
;
19 import javax
.xml
.bind
.annotation
.XmlRootElement
;
20 import javax
.xml
.bind
.annotation
.XmlSchemaType
;
21 import javax
.xml
.bind
.annotation
.XmlType
;
23 import org
.apache
.log4j
.Logger
;
24 import org
.hibernate
.annotations
.Cascade
;
25 import org
.hibernate
.annotations
.CascadeType
;
26 import org
.hibernate
.envers
.Audited
;
28 import eu
.etaxonomy
.cdm
.model
.common
.ReferencedEntityBase
;
29 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
32 * The class representing a typification of a {@link TaxonNameBase taxon name} with a {@link Rank rank}
33 * above "species aggregate" by another taxon name.<BR>
34 * According to nomenclature a type of a genus name or of any subdivision of a
35 * genus can only be a species name. A type of a family name or of any
36 * subdivision of a family is a genus name.<BR>
37 * Moreover the designation of a particular taxon name as a type might be
38 * nomenclaturally rejected or conserved. Depending on the date of publication,
39 * the same typification could be rejected according to one reference and later
40 * be conserved according to another reference, but a name type designation
41 * cannot be simultaneously rejected and conserved.<BR>
42 * Name type designations are treated as {@link TypeDesignationBase type designations}
43 * and not as {@link NameRelationship name relationships}.
45 * @see TypeDesignationBase
46 * @see SpecimenTypeDesignation
49 * @created 08-Nov-2007 13:06:38
51 @XmlRootElement(name
= "NameTypeDesignation")
52 @XmlAccessorType(XmlAccessType
.FIELD
)
53 @XmlType(name
= "NameTypeDesignation", propOrder
= {
61 public class NameTypeDesignation
extends TypeDesignationBase
implements ITypeDesignation
{
63 static Logger logger
= Logger
.getLogger(NameTypeDesignation
.class);
65 @XmlElement(name
= "IsRejectedType")
66 private boolean rejectedType
;
68 @XmlElement(name
= "IsConservedType")
69 private boolean conservedType
;
71 @XmlElement(name
= "IsLectoType")
72 private boolean lectoType
;
74 @XmlElement(name
= "TypeName")
76 @XmlSchemaType(name
= "IDREF")
77 @ManyToOne(fetch
= FetchType
.LAZY
)
78 @Cascade(CascadeType
.SAVE_UPDATE
)
79 private TaxonNameBase typeName
;
81 // @XmlElement(name = "HomotypicalGroup")
83 // @XmlSchemaType(name = "IDREF")
84 // private HomotypicalGroup homotypicalGroup;
88 // ************* CONSTRUCTORS *************/
90 * Class constructor: creates a new empty name type designation.
92 * @see #NameTypeDesignation(TaxonNameBase, ReferenceBase, String, String, boolean, boolean, boolean)
94 protected NameTypeDesignation() {
99 * Class constructor: creates a new name type designation instance
100 * (including its {@link eu.etaxonomy.cdm.model.reference.ReferenceBase reference source} and eventually
101 * the taxon name string originally used by this reference when establishing
102 * the former designation).
104 * @param typeName the taxon name used as a type
105 * @param citation the reference source for the new designation
106 * @param citationMicroReference the string with the details describing the exact localisation within the reference
107 * @param originalNameString the taxon name string used originally in the reference source for the new designation
108 * @param isRejectedType the boolean flag indicating whether the competent authorities rejected
109 * <i>this</i> name type designation
110 * @param isConservedType the boolean flag indicating whether the competent authorities conserved
111 * <i>this</i> name type designation
112 * @param isNotDesignated the boolean flag indicating whether there is no name type at all for
113 * <i>this</i> name type designation
114 * @see #NameTypeDesignation()
115 * @see TypeDesignationBase#isNotDesignated()
116 * @see TaxonNameBase#addNameTypeDesignation(TaxonNameBase, ReferenceBase, String, String, boolean, boolean, boolean, boolean, boolean)
118 protected NameTypeDesignation(TaxonNameBase typeName
, ReferenceBase citation
, String citationMicroReference
,
119 String originalNameString
, boolean rejectedType
, boolean conservedType
, boolean isNotDesignated
) {
120 super(citation
, citationMicroReference
, originalNameString
, isNotDesignated
);
121 this.setTypeName(typeName
);
122 this.rejectedType
= rejectedType
;
123 this.conservedType
= conservedType
;
126 //********* METHODS **************************************/
130 * Returns the {@link TaxonNameBase taxon name} that plays the role of the
131 * taxon name type in <i>this</i> taxon name type designation. The {@link Rank rank}
132 * of the taxon name type must be "species".
134 public TaxonNameBase
getTypeName(){
135 return this.typeName
;
138 * @see #getTypeName()
140 private void setTypeName(TaxonNameBase typeName
){
141 this.typeName
= typeName
;
145 * Returns the boolean value "true" if the competent authorities decided to
146 * reject the use of the species taxon name as the type for <i>this</i> taxon
147 * name type designation.
149 * @see #isConservedType()
151 public boolean isRejectedType(){
152 return this.rejectedType
;
155 * @see #isRejectedType()
157 public void setRejectedType(boolean rejectedType
){
158 this.rejectedType
= rejectedType
;
162 * Returns the boolean value "true" if the competent authorities decided to
163 * conserve the use of the species taxon name as the type for <i>this</i> taxon
164 * name type designation.
166 * @see #isRejectedType()
168 public boolean isConservedType(){
169 return this.conservedType
;
172 * @see #isConservedType()
174 public void setConservedType(boolean conservedType
){
175 this.conservedType
= conservedType
;
179 * Returns the boolean value "true" if the use of the species {@link TaxonNameBase taxon name}
180 * as the type for <i>this</i> taxon name type designation was posterior to the
181 * publication of the typified taxon name. In this case the taxon name type
182 * designation should have a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase reference} that is different to the
183 * {@link TaxonNameBase#getNomenclaturalReference() nomenclatural reference} of the typified taxon name.
185 * @see ReferencedEntityBase#getCitation()
188 * @see eu.etaxonomy.cdm.model.name.ITypeDesignation#isLectoType()
190 public boolean isLectoType() {
195 * @see #isLectoType()
197 public void setLectoType(boolean lectoType
) {
198 this.lectoType
= lectoType
;