Project

General

Profile

Download (15.3 KB) Statistics
| Branch: | Tag: | Revision:
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

    
14

    
15
import java.util.HashMap;
16
import java.util.Map;
17
import java.util.UUID;
18

    
19
import javax.persistence.Entity;
20
import javax.persistence.Transient;
21
import javax.xml.bind.annotation.XmlAccessType;
22
import javax.xml.bind.annotation.XmlAccessorType;
23
import javax.xml.bind.annotation.XmlType;
24

    
25
import org.apache.log4j.Logger;
26
import org.hibernate.envers.Audited;
27

    
28
import eu.etaxonomy.cdm.model.common.TermType;
29
import eu.etaxonomy.cdm.model.common.TermVocabulary;
30

    
31
/**
32
 * The class representing status (categories) of {@link SpecimenTypeDesignation specimen type designations}
33
 * for a {@link TaxonName taxon name} or a set of them. Within this set {@link NameRelationshipType#BASIONYM() basionyms}
34
 * or {@link NameRelationshipType#REPLACED_SYNONYM() replaced synonyms}, in case of reclassifications,
35
 * will be here referred as "type-bringing" taxon names.
36
 * <P>
37
 * The different status indicate whether the {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimens} used as types
38
 * in a designation are duplicates, replacements, related specimens etc.
39
 * <P>
40
 * A standard (ordered) list of type designation status instances will be
41
 * automatically created as the project starts. But this class allows to extend
42
 * this standard list by creating new instances of additional type designation
43
 * status if needed.
44
 * <P>
45
 * This class corresponds to: <ul>
46
 * <li> NomencalturalTypeTypeTerm according to the TDWG ontology
47
 * <li> NomenclaturalTypeStatusOfUnitsEnum according to the TCS
48
 * </ul>
49
 *
50
 * @author m.doering
51
 * @since 08-Nov-2007 13:07:00
52
 */
53
@XmlAccessorType(XmlAccessType.FIELD)
54
@XmlType(name = "SpecimenTypeDesignationStatus")
55
@Entity
56
//@Indexed disabled to reduce clutter in indexes, since this type is not used by any search
57
//@Indexed(index = "eu.etaxonomy.cdm.model.common.DefinedTermBase")
58
@Audited
59
public class SpecimenTypeDesignationStatus extends TypeDesignationStatusBase<SpecimenTypeDesignationStatus> {
60
	private static final long serialVersionUID = -7918261741824966182L;
61
	@SuppressWarnings("unused")
62
	private static final Logger logger = Logger.getLogger(SpecimenTypeDesignationStatus.class);
63

    
64
	protected static Map<UUID, SpecimenTypeDesignationStatus> termMap = null;
65

    
66
	private static final UUID uuidType = UUID.fromString("7194020b-a326-4b47-9bfe-9f31a30aba7f");
67
	private static final UUID uuidHolotype = UUID.fromString("a407dbc7-e60c-46ff-be11-eddf4c5a970d");
68
	private static final UUID uuidLectotype = UUID.fromString("05002d46-083e-4b27-8731-2e7c28a8825c");
69
	private static final UUID uuidNeotype = UUID.fromString("26e13359-8f77-4e40-a85a-56c01782fce0");
70
	private static final UUID uuidEpitype = UUID.fromString("989a2715-71d5-4fbe-aa9a-db9168353744");
71
	private static final UUID uuidIsolectotype = UUID.fromString("7a1a8a53-78f4-4fc0-89f7-782e94992d08");
72
	private static final UUID uuidIsoneotype = UUID.fromString("7afc2f4f-f70a-4aa5-80a5-87764f746bde");
73
	private static final UUID uuidIsotype = UUID.fromString("93ef8257-0a08-47bb-9b36-542417ae7560");
74
	private static final UUID uuidParaneotype = UUID.fromString("0c39e2a5-2fe0-4d4f-819a-f609b5340339");
75
	private static final UUID uuidParatype = UUID.fromString("eb7df2e5-d9a7-479d-970c-c6f2b0a761d7");
76
	private static final UUID uuidSecondStepLectotype = UUID.fromString("01d91053-7004-4984-aa0d-9f4de59d6205");
77
	private static final UUID uuidSecondStepNeotype = UUID.fromString("8d2fed1f-242e-4bcf-bbd7-e85133e479dc");
78
	private static final UUID uuidSyntype = UUID.fromString("f3b60bdb-4638-4ca9-a0c7-36e77d8459bb");
79
	private static final UUID uuidParalectotype = UUID.fromString("7244bc51-14d8-41a6-9524-7dc5303bba29");
80
	private static final UUID uuidIsoepitype = UUID.fromString("95b90696-e103-4bc0-b60b-c594983fb566");
81
	private static final UUID uuidIconotype = UUID.fromString("643513d0-32f5-46ba-840b-d9b9caf8160f");
82
	private static final UUID uuidPhototype = UUID.fromString("b7807acc-f559-474e-ad4a-e7a41e085e34");
83
	private static final UUID uuidUnspecified = UUID.fromString("230fd762-b143-49de-ac2e-744bcc48a63b");
84
	private static final UUID uuidOriginalMaterial = UUID.fromString("49c96cae-6be6-401e-9b36-1bc12d9dc8f9");
85
	private static final UUID uuidIsosyntype = UUID.fromString("052a5ff0-8e9a-4355-b24f-5e4bb6071f44");
86
	private static final UUID uuidIsoparatype = UUID.fromString("497137f3-b614-4183-8a22-97fcd6e2bdd8");
87

    
88
//********************************** Constructor *********************************/
89

    
90
  	//for hibernate use only
91
  	@Deprecated
92
  	protected SpecimenTypeDesignationStatus() {
93
		super(TermType.SpecimenTypeDesignationStatus);
94
	}
95

    
96

    
97
	/**
98
	 * Class constructor: creates an additional type designation status instance
99
	 * with a description (in the {@link eu.etaxonomy.cdm.model.common.Language#DEFAULT() default language}), a label
100
	 * and a label abbreviation.
101
	 *
102
	 * @param	term  		 the string (in the default language) describing the
103
	 * 						 new type designation status to be created
104
	 * @param	label  		 the string identifying the new type designation
105
	 * 						 status to be created
106
	 * @param	labelAbbrev  the string identifying (in abbreviated form) the
107
	 * 						 new type designation status to be created
108
	 * @see 				 #TypeDesignationStatus()
109
	 */
110
	private SpecimenTypeDesignationStatus(String term, String label, String labelAbbrev) {
111
		super(TermType.SpecimenTypeDesignationStatus, term, label, labelAbbrev);
112
	}
113

    
114
//************************** METHODS ********************************
115

    
116
	/* (non-Javadoc)
117
	 * @see eu.etaxonomy.cdm.model.common.DefinedTermBase#resetTerms()
118
	 */
119
	@Override
120
	public void resetTerms(){
121
		termMap = null;
122
	}
123

    
124

    
125
	protected static SpecimenTypeDesignationStatus findTermByUuid(UUID uuid){
126
        if (termMap == null || termMap.isEmpty()){
127
            return getTermByClassAndUUID(SpecimenTypeDesignationStatus.class, uuid);
128
        } else {
129
            return termMap.get(uuid);
130
        }
131
	}
132

    
133
	@Transient
134
	@Override
135
	public boolean isLectotype(){
136
		if (this.equals(LECTOTYPE()) ||
137
				this.equals(ISOLECTOTYPE()) ||
138
				this.equals(SECOND_STEP_LECTOTYPE()) ||
139
				this.equals(PARALECTOTYPE()) ){
140
			return true;
141
		}else{
142
			return false;
143
		}
144
	}
145

    
146
	/**
147
	 * Returns the "unknown" designation status. One may choose this status to indicate that the type
148
	 * designation is not
149
	 *
150
	 */
151
	public static final SpecimenTypeDesignationStatus TYPE(){
152
		return findTermByUuid(uuidType);
153
	}
154

    
155
	/**
156
	 * Returns the "holotype" designation status. A holotype of a
157
	 * set of names is the one {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnit specimen or illustration}
158
	 * designated as the nomenclatural type by the {@link NonViralName#getCombinationAuthorship() author} of the
159
	 * "type-bringing" {@link TaxonName taxon name} (or by the author of a later validated
160
	 * "invalid" taxon name).
161
	 *
162
	 * @see		NameRelationshipType#VALIDATED_BY_NAME()
163
	 */
164
	public static final SpecimenTypeDesignationStatus HOLOTYPE(){
165
		return findTermByUuid(uuidHolotype);
166
	}
167

    
168
	/**
169
	 * Returns the "lectotype" designation status. A lectotype is a
170
	 * {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnit specimen or illustration} designated as the nomenclatural type,
171
	 * when no holotype was indicated at the time of publication of the
172
	 * "type-bringing" {@link TaxonName taxon name}, when the
173
	 * holotype is found to to be assigned to taxon names belonging to more than one
174
	 * {@link HomotypicalGroup homotypical group}, or as long as it is missing.
175
	 *
176
	 * @see	#HOLOTYPE()
177
	 */
178
	public static final SpecimenTypeDesignationStatus LECTOTYPE(){
179
		return findTermByUuid(uuidLectotype);
180
	}
181

    
182
	/**
183
	 * Returns the "neotype" designation status. A neotype is a
184
	 * {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnit specimen or illustration} selected to serve as nomenclatural type
185
	 * as long as all of the material on which the "type-bringing" {@link TaxonName taxon name} was based
186
	 * is missing.
187
	 *
188
	 * @see	#HOLOTYPE()
189
	 */
190
	public static final SpecimenTypeDesignationStatus NEOTYPE(){
191
		return findTermByUuid(uuidNeotype);
192
	}
193

    
194
	/**
195
	 * Returns the "epitype" designation status. An epitype is a
196
	 * {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnit specimen or illustration} selected to serve as an interpretative type
197
	 * when the holotype, lectotype or previously designated neotype, or all
198
	 * original material associated with the {@link NomenclaturalStatusType#VALID() validly} published "type-bringing"
199
	 * {@link TaxonName taxon name}, is demonstrably ambiguous and cannot be critically
200
	 * identified for purposes of the precise application of the taxon name.
201
	 * When an epitype is designated, the holotype, lectotype or neotype that
202
	 * the epitype supports must be explicitly cited.
203
	 *
204
	 * @see	#HOLOTYPE()
205
	 * @see	#LECTOTYPE()
206
	 * @see	#NEOTYPE()
207
	 */
208
	public static final SpecimenTypeDesignationStatus EPITYPE(){
209
		return findTermByUuid(uuidEpitype);
210
	}
211

    
212
	/**
213
	 * Returns the "isotype" designation status. </BR>An isotype is any duplicate of
214
	 * the holotype; it is always a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen}.
215
	 *
216
	 * @see	#HOLOTYPE()
217
	 */
218
	public static final SpecimenTypeDesignationStatus ISOTYPE(){
219
		return findTermByUuid(uuidIsotype);
220
	}
221

    
222
	/**
223
	 * Returns the "syntype" designation status. </BR>A syntype is any one of two or
224
	 * more {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimens} cited in the {@link TaxonName#getNomenclaturalReference() protologue} of the
225
	 * "type-bringing" {@link TaxonName taxon name} when no holotype was designated,
226
	 * or any one of two or more specimens simultaneously designated as types.
227
	 *
228
	 * @see	#HOLOTYPE()
229
	 */
230
	public static final SpecimenTypeDesignationStatus SYNTYPE(){
231
		return findTermByUuid(uuidSyntype);
232
	}
233

    
234
	/**
235
	 * Returns the "isosyntype" designation status. </BR>An isosyntype is any
236
	 * {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen} cited in the
237
	 * protologue of the type-bringing {@link TaxonName taxon name} which is
238
	 * a duplicate of a {@link eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus#SYNTYPE() syntype}.
239
	 * See also article 9.10 of the ICBN
240
	 *
241
	 * @see	#HOLOTYPE()
242
	 */
243
	public static final SpecimenTypeDesignationStatus ISOSYNTYPE(){
244
		return findTermByUuid(uuidIsosyntype);
245
	}
246

    
247
	/**
248
	 * Returns the "paratype" designation status. </BR>A paratype is a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen}
249
	 * cited in the {@link TaxonName#getNomenclaturalReference() protologue} of the "type-bringing"
250
	 * {@link TaxonName taxon name} that is neither the holotype nor an isotype,
251
	 * nor one of the syntypes if two or more specimens were simultaneously
252
	 * designated as types.
253
	 *
254
	 * @see	#HOLOTYPE()
255
	 * @see	#ISOTYPE()
256
	 * @see	#SYNTYPE()
257
	 */
258
	public static final SpecimenTypeDesignationStatus PARATYPE(){
259
		return findTermByUuid(uuidParatype);
260
	}
261

    
262
	/**
263
	 * Returns the "isolectotype" designation status. </BR>
264
	 * An isolectotype is any
265
	 * duplicate of the lectotype; it is always a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen}.
266
	 *
267
	 * @see	#LECTOTYPE()
268
	 */
269
	public static final SpecimenTypeDesignationStatus ISOLECTOTYPE(){
270
		return findTermByUuid(uuidIsolectotype);
271
	}
272

    
273
	/**
274
	 * Returns the "isoneotype" designation status. </BR>
275
	 * An isoneotype is any
276
	 * duplicate of the neotype; it is always a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen}.
277
	 *
278
	 * @see	#NEOTYPE()
279
	 */
280
	public static final SpecimenTypeDesignationStatus ISONEOTYPE(){
281
		return findTermByUuid(uuidIsoneotype);
282
	}
283

    
284
	/**
285
	 * Returns the "isoparatype" designation status. </BR>
286
	 * An isoparatype is any
287
	 * duplicate of a paratype; it is always a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen}.
288
	 *
289
	 * @see	#PARATYPE()
290
	 * @see #ISOTYPE()
291
	 */
292
	public static final SpecimenTypeDesignationStatus ISOPARATYPE(){
293
		return findTermByUuid(uuidIsoparatype);
294
	}
295

    
296
	/**
297
	 * Returns the "paraneotype" designation status. </BR>
298
	 * A paraneotype is a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen},
299
	 * cited when selecting a neotype, other than the neotype itself. Also
300
	 * called "neoparatype" in zoology.
301
	 *
302
	 * @see	#NEOTYPE()
303
	 */
304
	public static final SpecimenTypeDesignationStatus PARANEOTYPE(){
305
		return findTermByUuid(uuidParaneotype);
306
	}
307

    
308
	/**
309
	 * Returns the "second step lectotype" designation status. </BR>
310
	 * A second step lectotype is a {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnit specimen or illustration}, designated as lectotype
311
	 * in order to substitute another already existing lectotype.
312
	 *
313
	 * @see	#LECTOTYPE()
314
	 */
315
	public static final SpecimenTypeDesignationStatus SECOND_STEP_LECTOTYPE(){
316
		return findTermByUuid(uuidSecondStepLectotype);
317
	}
318

    
319
	/**
320
	 * Returns the "second step neotype" designation status. </BR>
321
	 * A second step neotype is a {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnit specimen or illustration}, designated as neotype
322
	 * in order to substitute another already existing neotype.
323
	 *
324
	 * @see	#LECTOTYPE()
325
	 */
326
	public static final SpecimenTypeDesignationStatus SECOND_STEP_NEOTYPE(){
327
		return findTermByUuid(uuidSecondStepNeotype);
328
	}
329

    
330
	/**
331
	 * Returns the "paralectotype" designation status. </BR>
332
	 * A paralectotype is a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen}, cited when designating a lectotype, other than
333
	 * the lectotype itself. Also called "lectoparatype" in zoology.
334
	 *
335
	 * @see	#LECTOTYPE()
336
	 */
337
	public static final SpecimenTypeDesignationStatus PARALECTOTYPE(){
338
		return findTermByUuid(uuidParalectotype);
339
	}
340

    
341
	/**
342
	 * Returns the "isoepitype" designation status. An isoepitype is any
343
	 * duplicate of the epitype; it is always a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen}.
344
	 *
345
	 * @see	#EPITYPE()
346
	 */
347
	public static final SpecimenTypeDesignationStatus ISOEPITYPE(){
348
		return findTermByUuid(uuidIsoepitype);
349
	}
350

    
351
	/**
352
	 * Returns the "iconotype" designation status. An iconotype is a holotype or
353
	 * a lectotype that is a {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnit drawing}
354
	 * and not a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen}.
355
	 * "Iconotype" does not have type status according to the ICBN.
356
	 *
357
	 * @see	#HOLOTYPE()
358
	 * @see	#LECTOTYPE()
359
	 */
360
	public static final SpecimenTypeDesignationStatus ICONOTYPE(){
361
		return findTermByUuid(uuidIconotype);
362
	}
363

    
364
	/**
365
	 * Returns the "unspecific" type designation status. Used if from literature where it is not
366
	 * clear if it refers to another publication not cited or if it is a new designation.
367
	 *
368
	 */
369
	public static final SpecimenTypeDesignationStatus UNSPECIFIC(){
370
		return findTermByUuid(uuidUnspecified);
371
	}
372

    
373
	/**
374
	 * Returns the "original material" type designation status.
375
	 * Botanical term for material from which a lectotype can be designated.
376
	 * "Original material" does not have type status according to the ICBN.
377
	 *
378
	 */
379
	public static final SpecimenTypeDesignationStatus ORIGINAL_MATERIAL(){
380
		return findTermByUuid(uuidOriginalMaterial);
381
	}
382

    
383

    
384
	/**
385
	 * Returns the "phototype" type designation status.
386
	 * "Phototype" does not have type status according to the ICBN.
387
	 *
388
	 */
389
	public static final SpecimenTypeDesignationStatus PHOTOTYPE(){
390
		return findTermByUuid(uuidPhototype);
391
	}
392

    
393
	@Override
394
	protected void setDefaultTerms(TermVocabulary<SpecimenTypeDesignationStatus> termVocabulary) {
395
		termMap = new HashMap<UUID, SpecimenTypeDesignationStatus>();
396
		for (SpecimenTypeDesignationStatus term : termVocabulary.getTerms()){
397
			termMap.put(term.getUuid(), term);
398
		}
399

    
400
	}
401

    
402
}
(28-28/37)