Project

General

Profile

Download (15.5 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.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
26
import org.hibernate.envers.Audited;
27

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

    
113
//************************** METHODS ********************************
114

    
115
	@Override
116
	public void resetTerms(){
117
		termMap = null;
118
	}
119

    
120

    
121
	protected static SpecimenTypeDesignationStatus findTermByUuid(UUID uuid){
122
        if (termMap == null || termMap.isEmpty()){
123
            return getTermByClassAndUUID(SpecimenTypeDesignationStatus.class, uuid);
124
        } else {
125
            return termMap.get(uuid);
126
        }
127
	}
128

    
129
	//#8140
130
	@Transient
131
	@Override
132
	public boolean hasDesignationSource(){
133
		if (this.equals(LECTOTYPE()) ||
134
				this.equals(ISOLECTOTYPE()) ||
135
				this.equals(SECOND_STEP_LECTOTYPE()) ||
136
//				this.equals(PARALECTOTYPE()) ||  //removed due to #8140#note-5
137
				//with source but not "lecto"
138
				this.equals(EPITYPE()) ||
139
				this.equals(ISOEPITYPE()) ||
140
				this.equals(NEOTYPE()) ||
141
				this.equals(ISONEOTYPE()) ||
142
				this.equals(SECOND_STEP_NEOTYPE())
143
		        ){
144
			return true;
145
		}else{
146
			return false;
147
		}
148
	}
149

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
387

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

    
397
	@Override
398
	protected void setDefaultTerms(TermVocabulary<SpecimenTypeDesignationStatus> termVocabulary) {
399
		termMap = new HashMap<>();
400
		for (SpecimenTypeDesignationStatus term : termVocabulary.getTerms()){
401
			termMap.put(term.getUuid(), term);
402
		}
403
	}
404

    
405
}
(32-32/39)