1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
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.
|
8
|
*/
|
9
|
|
10
|
package eu.etaxonomy.cdm.model.name;
|
11
|
|
12
|
|
13
|
import javax.persistence.Entity;
|
14
|
import javax.persistence.FetchType;
|
15
|
import javax.persistence.ManyToOne;
|
16
|
import javax.persistence.Transient;
|
17
|
import javax.xml.bind.annotation.XmlAccessType;
|
18
|
import javax.xml.bind.annotation.XmlAccessorType;
|
19
|
import javax.xml.bind.annotation.XmlElement;
|
20
|
import javax.xml.bind.annotation.XmlIDREF;
|
21
|
import javax.xml.bind.annotation.XmlRootElement;
|
22
|
import javax.xml.bind.annotation.XmlSchemaType;
|
23
|
import javax.xml.bind.annotation.XmlType;
|
24
|
|
25
|
import org.apache.log4j.Logger;
|
26
|
import org.hibernate.annotations.Cascade;
|
27
|
import org.hibernate.annotations.CascadeType;
|
28
|
import org.hibernate.envers.Audited;
|
29
|
|
30
|
import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
|
31
|
import eu.etaxonomy.cdm.model.occurrence.Specimen;
|
32
|
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
|
33
|
|
34
|
/**
|
35
|
* The class representing a typification of one or several {@link TaxonNameBase taxon names} by a
|
36
|
* {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase specimen or a figure}. All {@link TaxonNameBase taxon names}
|
37
|
* which have a {@link Rank rank} "species aggregate" or lower can only be typified
|
38
|
* by specimens. Moreover each typification by a specimen (or by a figure) has a
|
39
|
* {@link SpecimenTypeDesignationStatus status} like "holotype" or "isotype".
|
40
|
* <P>
|
41
|
* This class corresponds to: <ul>
|
42
|
* <li> NomenclaturalType according to the TDWG ontology
|
43
|
* <li> Typification (partially) according to the TCS
|
44
|
* <li> NomenclaturalTypeDesignation according to the ABCD schema
|
45
|
* </ul>
|
46
|
*
|
47
|
* @see TypeDesignationBase
|
48
|
* @see NameTypeDesignation
|
49
|
* @author m.doering
|
50
|
* @version 1.0
|
51
|
* @created 08-Nov-2007 13:06:38
|
52
|
*/
|
53
|
@XmlRootElement(name = "SpecimenTypeDesignation")
|
54
|
@XmlAccessorType(XmlAccessType.FIELD)
|
55
|
@XmlType(name = "SpecimenTypeDesignation", propOrder = {
|
56
|
"typeSpecimen"
|
57
|
})
|
58
|
@Entity
|
59
|
@Audited
|
60
|
public class SpecimenTypeDesignation extends TypeDesignationBase<SpecimenTypeDesignationStatus>
|
61
|
implements ITypeDesignation {
|
62
|
|
63
|
private static final Logger logger = Logger.getLogger(SpecimenTypeDesignation.class);
|
64
|
|
65
|
@XmlElement(name = "TypeSpecimen")
|
66
|
@XmlIDREF
|
67
|
@XmlSchemaType(name = "IDREF")
|
68
|
@ManyToOne(fetch = FetchType.LAZY)
|
69
|
@Cascade(CascadeType.SAVE_UPDATE)
|
70
|
private DerivedUnitBase typeSpecimen;
|
71
|
|
72
|
// /**
|
73
|
// * Creates a new specimen type designation instance
|
74
|
// * (including its {@link reference.ReferenceBase reference source} and eventually
|
75
|
// * the taxon name string originally used by this reference when establishing
|
76
|
// * the former designation) and adds it to the corresponding
|
77
|
// * {@link HomotypicalGroup#getSpecimenTypeDesignations() specimen type designation set} of the
|
78
|
// * {@link HomotypicalGroup homotypical group}.
|
79
|
// *
|
80
|
// * @param specimen the derived unit (specimen or figure) used as type
|
81
|
// * @param status the type designation status
|
82
|
// * @param citation the reference source for the new designation
|
83
|
// * @param citationMicroReference the string with the details describing the exact localisation within the reference
|
84
|
// * @param originalNameString the taxon name string used originally in the reference source for the new designation
|
85
|
// * @see #SpecimenTypeDesignation(DerivedUnitBase, TypeDesignationStatus, ReferenceBase, String, String)
|
86
|
// * @see HomotypicalGroup#addSpecimenTypeDesignation(SpecimenTypeDesignation, boolean)
|
87
|
// * @see occurrence.DerivedUnitBase
|
88
|
// */
|
89
|
// protected static SpecimenTypeDesignation NewInstance2(DerivedUnitBase specimen, TypeDesignationStatus status,
|
90
|
// ReferenceBase citation, String citationMicroReference, String originalNameString){
|
91
|
// SpecimenTypeDesignation specTypeDesig = new SpecimenTypeDesignation(specimen, status, citation, citationMicroReference, originalNameString);
|
92
|
// return specTypeDesig;
|
93
|
// }
|
94
|
|
95
|
|
96
|
// ************* CONSTRUCTORS *************/
|
97
|
/**
|
98
|
* Class constructor: creates a new empty specimen type designation.
|
99
|
*
|
100
|
* @see #SpecimenTypeDesignation(DerivedUnitBase, SpecimenTypeDesignationStatus,
|
101
|
* ReferenceBase, String, String, boolean)
|
102
|
*/
|
103
|
protected SpecimenTypeDesignation(){
|
104
|
}
|
105
|
|
106
|
/**
|
107
|
* Class constructor: creates a new specimen type designation instance
|
108
|
* (including its {@link eu.etaxonomy.cdm.model.reference.ReferenceBase reference source} and
|
109
|
* eventually the taxon name string originally used by this reference when
|
110
|
* establishing the former designation).
|
111
|
*
|
112
|
* @param specimen the derived unit (specimen or figure) used
|
113
|
* as type
|
114
|
* @param status the type designation status
|
115
|
* @param citation the reference source for the new designation
|
116
|
* @param citationMicroReference the string with the details describing
|
117
|
* the exact localisation within the reference
|
118
|
* @param originalNameString the taxon name string used originally in the
|
119
|
* reference source for the new designation
|
120
|
* @param isNotDesignated the boolean flag indicating whether there is no specimen type at all for
|
121
|
* <i>this</i> specimen type designation
|
122
|
* @see #SpecimenTypeDesignation()
|
123
|
* @see TaxonNameBase#addSpecimenTypeDesignation(Specimen, SpecimenTypeDesignationStatus, ReferenceBase, String, String, boolean, boolean)
|
124
|
* @see TypeDesignationBase#isNotDesignated()
|
125
|
* @see eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase
|
126
|
*/
|
127
|
protected SpecimenTypeDesignation(DerivedUnitBase specimen, SpecimenTypeDesignationStatus status, ReferenceBase citation, String citationMicroReference,
|
128
|
String originalNameString, boolean isNotDesignated) {
|
129
|
super(citation, citationMicroReference, originalNameString, isNotDesignated);
|
130
|
this.setTypeSpecimen(specimen);
|
131
|
this.setTypeStatus(status);
|
132
|
}
|
133
|
|
134
|
//********* METHODS **************************************/
|
135
|
|
136
|
/**
|
137
|
* Returns the {@link occurrence.DerivedUnitBase derived unit} (specimen or figure) that is used
|
138
|
* in <i>this</i> specimen type designation to typify the {@link TaxonNameBase taxon name}.
|
139
|
*
|
140
|
* @see #getHomotypicalGroup()
|
141
|
*/
|
142
|
public DerivedUnitBase getTypeSpecimen(){
|
143
|
return this.typeSpecimen;
|
144
|
}
|
145
|
/**
|
146
|
* @see #getTypeSpecimen()
|
147
|
*/
|
148
|
public void setTypeSpecimen(DerivedUnitBase typeSpecimen){
|
149
|
this.typeSpecimen = typeSpecimen;
|
150
|
}
|
151
|
|
152
|
/* (non-Javadoc)
|
153
|
* @see eu.etaxonomy.cdm.model.name.ITypeDesignation#isLectoType()
|
154
|
*/
|
155
|
/**
|
156
|
* Returns the boolean value indicating whether <i>this</i> specimen type
|
157
|
* designation has a "lectotype" status (true) or not (false).<BR>
|
158
|
* A lectotype is a {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase specimen or illustration} designated as the
|
159
|
* nomenclatural type, when no holotype was indicated at the time of
|
160
|
* publication of the "type-bringing" {@link TaxonNameBase taxon name}, when the
|
161
|
* holotype is found to belong to more than one taxon name,
|
162
|
* or as long as it is missing.
|
163
|
*
|
164
|
* @see SpecimenTypeDesignationStatus#isLectotype()
|
165
|
* @see SpecimenTypeDesignationStatus#HOLOTYPE()
|
166
|
*/
|
167
|
@Transient
|
168
|
public boolean isLectoType() {
|
169
|
return getTypeStatus().isLectotype();
|
170
|
}
|
171
|
|
172
|
}
|