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
.persistence
.Transient
;
16 import javax
.xml
.bind
.annotation
.XmlAccessType
;
17 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
18 import javax
.xml
.bind
.annotation
.XmlElement
;
19 import javax
.xml
.bind
.annotation
.XmlIDREF
;
20 import javax
.xml
.bind
.annotation
.XmlRootElement
;
21 import javax
.xml
.bind
.annotation
.XmlSchemaType
;
22 import javax
.xml
.bind
.annotation
.XmlType
;
24 import org
.apache
.log4j
.Logger
;
25 import org
.hibernate
.annotations
.Cascade
;
26 import org
.hibernate
.annotations
.CascadeType
;
27 import org
.hibernate
.envers
.Audited
;
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
<NameTypeDesignationStatus
>
62 implements ITypeDesignation
{
64 final static Logger logger
= Logger
.getLogger(NameTypeDesignation
.class);
66 @XmlElement(name
= "IsRejectedType")
67 private boolean rejectedType
;
69 @XmlElement(name
= "IsConservedType")
70 private boolean conservedType
;
72 // @XmlElement(name = "IsLectoType")
73 // private boolean lectoType;
75 @XmlElement(name
= "TypeName")
77 @XmlSchemaType(name
= "IDREF")
78 @ManyToOne(fetch
= FetchType
.LAZY
)
79 @Cascade(CascadeType
.SAVE_UPDATE
)
80 private TaxonNameBase typeName
;
83 public static NameTypeDesignation
NewInstance() {
84 return new NameTypeDesignation();
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
, NameTypeDesignationStatus status
,
119 ReferenceBase citation
, String citationMicroReference
, String originalNameString
) {
120 super(citation
, citationMicroReference
, originalNameString
);
121 this.setTypeName(typeName
);
122 this.setTypeStatus(status
);
126 * Class constructor: creates a new name type designation instance
127 * (including its {@link eu.etaxonomy.cdm.model.reference.ReferenceBase reference source} and eventually
128 * the taxon name string originally used by this reference when establishing
129 * the former designation).
131 * @param typeName the taxon name used as a type
132 * @param citation the reference source for the new designation
133 * @param citationMicroReference the string with the details describing the exact localisation within the reference
134 * @param originalNameString the taxon name string used originally in the reference source for the new designation
135 * @param isRejectedType the boolean flag indicating whether the competent authorities rejected
136 * <i>this</i> name type designation
137 * @param isConservedType the boolean flag indicating whether the competent authorities conserved
138 * <i>this</i> name type designation
139 * @param isNotDesignated the boolean flag indicating whether there is no name type at all for
140 * <i>this</i> name type designation
141 * @see #NameTypeDesignation()
142 * @see TypeDesignationBase#isNotDesignated()
143 * @see TaxonNameBase#addNameTypeDesignation(TaxonNameBase, ReferenceBase, String, String, boolean, boolean, boolean, boolean, boolean)
145 protected NameTypeDesignation( TaxonNameBase typeName
,
146 ReferenceBase citation
,
147 String citationMicroReference
,
148 String originalNameString
,
149 NameTypeDesignationStatus status
,
150 boolean rejectedType
,
151 boolean conservedType
,
152 boolean isNotDesignated
154 this(typeName
, status
, citation
, citationMicroReference
, originalNameString
);
155 this.setNotDesignated(isNotDesignated
);
156 this.rejectedType
= rejectedType
;
157 this.conservedType
= conservedType
;
160 //********* METHODS **************************************/
164 * Returns the {@link TaxonNameBase taxon name} that plays the role of the
165 * taxon name type in <i>this</i> taxon name type designation. The {@link Rank rank}
166 * of the taxon name type must be "species".
168 public TaxonNameBase
getTypeName(){
169 return this.typeName
;
172 * @see #getTypeName()
174 public void setTypeName(TaxonNameBase typeName
){
175 this.typeName
= typeName
;
179 * Returns the boolean value "true" if the competent authorities decided to
180 * reject the use of the species taxon name as the type for <i>this</i> taxon
181 * name type designation.
183 * @see #isConservedType()
185 public boolean isRejectedType(){
186 return this.rejectedType
;
189 * @see #isRejectedType()
191 public void setRejectedType(boolean rejectedType
){
192 this.rejectedType
= rejectedType
;
196 * Returns the boolean value "true" if the competent authorities decided to
197 * conserve the use of the species taxon name as the type for <i>this</i> taxon
198 * name type designation.
200 * @see #isRejectedType()
202 public boolean isConservedType(){
203 return this.conservedType
;
206 * @see #isConservedType()
208 public void setConservedType(boolean conservedType
){
209 this.conservedType
= conservedType
;
213 public boolean isLectoType() {
214 if (getTypeStatus() == null) {
217 return getTypeStatus().isLectotype();
221 * Returns the boolean value "true" if the use of the species {@link TaxonNameBase taxon name}
222 * as the type for <i>this</i> taxon name type designation was posterior to the
223 * publication of the typified taxon name. In this case the taxon name type
224 * designation should have a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase reference} that is different to the
225 * {@link TaxonNameBase#getNomenclaturalReference() nomenclatural reference} of the typified taxon name.
227 * @see ReferencedEntityBase#getCitation()
230 // * @see eu.etaxonomy.cdm.model.name.ITypeDesignation#isLectoType()
232 // public boolean isLectoType() {
237 // * @see #isLectoType()
239 // public void setLectoType(boolean lectoType) {
240 // this.lectoType = lectoType;