Project

General

Profile

Download (16.1 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
 * @created 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

    
134
	/**
135
	 * Returns the boolean value indicating whether <i>this</i> type designation
136
	 * status is itself "lectotype" or a kind of "lectotype" (true) or not
137
	 * (false). Returns false if <i>this</i> type designation status is null.<BR>
138
	 * A lectotype is a {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnit specimen or illustration} designated as the
139
	 * nomenclatural type, when no holotype was indicated at the time of
140
	 * publication of the "type-bringing" {@link TaxonName taxon name}, when the
141
	 * holotype is found to be assigned to taxon names belonging to more than
142
	 * one {@link HomotypicalGroup homotypical group}, or as long as it is missing.
143
	 *
144
	 * @see  #LECTOTYPE()
145
	 * @see  #HOLOTYPE()
146
	 * @see  eu.etaxonomy.cdm.model.common.DefinedTermBase#getKindOf()
147
	 */
148
	@Transient
149
	public boolean isLectotype(){
150
		if (this.equals(LECTOTYPE()) ||
151
				this.equals(ISOLECTOTYPE()) ||
152
				this.equals(SECOND_STEP_LECTOTYPE()) ||
153
				this.equals(PARALECTOTYPE()) ){
154
			return true;
155
		}else{
156
			return false;
157
		}
158
	}
159

    
160
	/**
161
	 * Returns the "unknown" designation status. One may choose this status to indicate that the type
162
	 * designation is not
163
	 *
164
	 */
165
	public static final SpecimenTypeDesignationStatus TYPE(){
166
		return findTermByUuid(uuidType);
167
	}
168

    
169
	/**
170
	 * Returns the "holotype" designation status. A holotype of a
171
	 * set of names is the one {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnit specimen or illustration}
172
	 * designated as the nomenclatural type by the {@link NonViralName#getCombinationAuthorship() author} of the
173
	 * "type-bringing" {@link TaxonName taxon name} (or by the author of a later validated
174
	 * "invalid" taxon name).
175
	 *
176
	 * @see		NameRelationshipType#VALIDATED_BY_NAME()
177
	 */
178
	public static final SpecimenTypeDesignationStatus HOLOTYPE(){
179
		return findTermByUuid(uuidHolotype);
180
	}
181

    
182
	/**
183
	 * Returns the "lectotype" designation status. A lectotype is a
184
	 * {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnit specimen or illustration} designated as the nomenclatural type,
185
	 * when no holotype was indicated at the time of publication of the
186
	 * "type-bringing" {@link TaxonName taxon name}, when the
187
	 * holotype is found to to be assigned to taxon names belonging to more than one
188
	 * {@link HomotypicalGroup homotypical group}, or as long as it is missing.
189
	 *
190
	 * @see	#HOLOTYPE()
191
	 */
192
	public static final SpecimenTypeDesignationStatus LECTOTYPE(){
193
		return findTermByUuid(uuidLectotype);
194
	}
195

    
196
	/**
197
	 * Returns the "neotype" designation status. A neotype is a
198
	 * {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnit specimen or illustration} selected to serve as nomenclatural type
199
	 * as long as all of the material on which the "type-bringing" {@link TaxonName taxon name} was based
200
	 * is missing.
201
	 *
202
	 * @see	#HOLOTYPE()
203
	 */
204
	public static final SpecimenTypeDesignationStatus NEOTYPE(){
205
		return findTermByUuid(uuidNeotype);
206
	}
207

    
208
	/**
209
	 * Returns the "epitype" designation status. An epitype is a
210
	 * {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnit specimen or illustration} selected to serve as an interpretative type
211
	 * when the holotype, lectotype or previously designated neotype, or all
212
	 * original material associated with the {@link NomenclaturalStatusType#VALID() validly} published "type-bringing"
213
	 * {@link TaxonName taxon name}, is demonstrably ambiguous and cannot be critically
214
	 * identified for purposes of the precise application of the taxon name.
215
	 * When an epitype is designated, the holotype, lectotype or neotype that
216
	 * the epitype supports must be explicitly cited.
217
	 *
218
	 * @see	#HOLOTYPE()
219
	 * @see	#LECTOTYPE()
220
	 * @see	#NEOTYPE()
221
	 */
222
	public static final SpecimenTypeDesignationStatus EPITYPE(){
223
		return findTermByUuid(uuidEpitype);
224
	}
225

    
226
	/**
227
	 * Returns the "isotype" designation status. </BR>An isotype is any duplicate of
228
	 * the holotype; it is always a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen}.
229
	 *
230
	 * @see	#HOLOTYPE()
231
	 */
232
	public static final SpecimenTypeDesignationStatus ISOTYPE(){
233
		return findTermByUuid(uuidIsotype);
234
	}
235

    
236
	/**
237
	 * Returns the "syntype" designation status. </BR>A syntype is any one of two or
238
	 * more {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimens} cited in the {@link TaxonName#getNomenclaturalReference() protologue} of the
239
	 * "type-bringing" {@link TaxonName taxon name} when no holotype was designated,
240
	 * or any one of two or more specimens simultaneously designated as types.
241
	 *
242
	 * @see	#HOLOTYPE()
243
	 */
244
	public static final SpecimenTypeDesignationStatus SYNTYPE(){
245
		return findTermByUuid(uuidSyntype);
246
	}
247

    
248
	/**
249
	 * Returns the "isosyntype" designation status. </BR>An isosyntype is any
250
	 * {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen} cited in the
251
	 * protologue of the type-bringing {@link TaxonName taxon name} which is
252
	 * a duplicate of a {@link eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus#SYNTYPE() syntype}.
253
	 * See also article 9.10 of the ICBN
254
	 *
255
	 * @see	#HOLOTYPE()
256
	 */
257
	public static final SpecimenTypeDesignationStatus ISOSYNTYPE(){
258
		return findTermByUuid(uuidIsosyntype);
259
	}
260

    
261
	/**
262
	 * Returns the "paratype" designation status. </BR>A paratype is a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen}
263
	 * cited in the {@link TaxonName#getNomenclaturalReference() protologue} of the "type-bringing"
264
	 * {@link TaxonName taxon name} that is neither the holotype nor an isotype,
265
	 * nor one of the syntypes if two or more specimens were simultaneously
266
	 * designated as types.
267
	 *
268
	 * @see	#HOLOTYPE()
269
	 * @see	#ISOTYPE()
270
	 * @see	#SYNTYPE()
271
	 */
272
	public static final SpecimenTypeDesignationStatus PARATYPE(){
273
		return findTermByUuid(uuidParatype);
274
	}
275

    
276
	/**
277
	 * Returns the "isolectotype" designation status. </BR>
278
	 * An isolectotype is any
279
	 * duplicate of the lectotype; it is always a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen}.
280
	 *
281
	 * @see	#LECTOTYPE()
282
	 */
283
	public static final SpecimenTypeDesignationStatus ISOLECTOTYPE(){
284
		return findTermByUuid(uuidIsolectotype);
285
	}
286

    
287
	/**
288
	 * Returns the "isoneotype" designation status. </BR>
289
	 * An isoneotype is any
290
	 * duplicate of the neotype; it is always a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen}.
291
	 *
292
	 * @see	#NEOTYPE()
293
	 */
294
	public static final SpecimenTypeDesignationStatus ISONEOTYPE(){
295
		return findTermByUuid(uuidIsoneotype);
296
	}
297

    
298
	/**
299
	 * Returns the "isoparatype" designation status. </BR>
300
	 * An isoparatype is any
301
	 * duplicate of a paratype; it is always a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen}.
302
	 *
303
	 * @see	#PARATYPE()
304
	 * @see #ISOTYPE()
305
	 */
306
	public static final SpecimenTypeDesignationStatus ISOPARATYPE(){
307
		return findTermByUuid(uuidIsoparatype);
308
	}
309

    
310
	/**
311
	 * Returns the "paraneotype" designation status. </BR>
312
	 * A paraneotype is a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen},
313
	 * cited when selecting a neotype, other than the neotype itself. Also
314
	 * called "neoparatype" in zoology.
315
	 *
316
	 * @see	#NEOTYPE()
317
	 */
318
	public static final SpecimenTypeDesignationStatus PARANEOTYPE(){
319
		return findTermByUuid(uuidParaneotype);
320
	}
321

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

    
333
	/**
334
	 * Returns the "second step neotype" designation status. </BR>
335
	 * A second step neotype is a {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnit specimen or illustration}, designated as neotype
336
	 * in order to substitute another already existing neotype.
337
	 *
338
	 * @see	#LECTOTYPE()
339
	 */
340
	public static final SpecimenTypeDesignationStatus SECOND_STEP_NEOTYPE(){
341
		return findTermByUuid(uuidSecondStepNeotype);
342
	}
343

    
344
	/**
345
	 * Returns the "paralectotype" designation status. </BR>
346
	 * A paralectotype is a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen}, cited when designating a lectotype, other than
347
	 * the lectotype itself. Also called "lectoparatype" in zoology.
348
	 *
349
	 * @see	#LECTOTYPE()
350
	 */
351
	public static final SpecimenTypeDesignationStatus PARALECTOTYPE(){
352
		return findTermByUuid(uuidParalectotype);
353
	}
354

    
355
	/**
356
	 * Returns the "isoepitype" designation status. An isoepitype is any
357
	 * duplicate of the epitype; it is always a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen}.
358
	 *
359
	 * @see	#EPITYPE()
360
	 */
361
	public static final SpecimenTypeDesignationStatus ISOEPITYPE(){
362
		return findTermByUuid(uuidIsoepitype);
363
	}
364

    
365
	/**
366
	 * Returns the "iconotype" designation status. An iconotype is a holotype or
367
	 * a lectotype that is a {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnit drawing}
368
	 * and not a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen}.
369
	 * "Iconotype" does not have type status according to the ICBN.
370
	 *
371
	 * @see	#HOLOTYPE()
372
	 * @see	#LECTOTYPE()
373
	 */
374
	public static final SpecimenTypeDesignationStatus ICONOTYPE(){
375
		return findTermByUuid(uuidIconotype);
376
	}
377

    
378
	/**
379
	 * Returns the "unspecific" type designation status. Used if from literature where it is not
380
	 * clear if it refers to another publication not cited or if it is a new designation.
381
	 *
382
	 */
383
	public static final SpecimenTypeDesignationStatus UNSPECIFIC(){
384
		return findTermByUuid(uuidUnspecified);
385
	}
386

    
387
	/**
388
	 * Returns the "original material" type designation status.
389
	 * Botanical term for material from which a lectotype can be designated.
390
	 * "Original material" does not have type status according to the ICBN.
391
	 *
392
	 */
393
	public static final SpecimenTypeDesignationStatus ORIGINAL_MATERIAL(){
394
		return findTermByUuid(uuidOriginalMaterial);
395
	}
396

    
397

    
398
	/**
399
	 * Returns the "phototype" type designation status.
400
	 * "Phototype" does not have type status according to the ICBN.
401
	 *
402
	 */
403
	public static final SpecimenTypeDesignationStatus PHOTOTYPE(){
404
		return findTermByUuid(uuidPhototype);
405
	}
406

    
407
	@Override
408
	protected void setDefaultTerms(TermVocabulary<SpecimenTypeDesignationStatus> termVocabulary) {
409
		termMap = new HashMap<UUID, SpecimenTypeDesignationStatus>();
410
		for (SpecimenTypeDesignationStatus term : termVocabulary.getTerms()){
411
			termMap.put(term.getUuid(), term);
412
		}
413

    
414
	}
415

    
416
}
(28-28/36)