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
;
15 import java
.util
.HashMap
;
17 import java
.util
.UUID
;
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
;
25 import org
.apache
.log4j
.Logger
;
26 import org
.hibernate
.envers
.Audited
;
27 import org
.hibernate
.search
.annotations
.Indexed
;
29 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
32 * The class representing status (categories) of {@link SpecimenTypeDesignation specimen type designations}
33 * for a {@link TaxonNameBase 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.
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.
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
45 * This class corresponds to: <ul>
46 * <li> NomencalturalTypeTypeTerm according to the TDWG ontology
47 * <li> NomenclaturalTypeStatusOfUnitsEnum according to the TCS
52 * @created 08-Nov-2007 13:07:00
54 @XmlAccessorType(XmlAccessType
.FIELD
)
55 @XmlType(name
= "SpecimenTypeDesignationStatus")
57 @Indexed(index
= "eu.etaxonomy.cdm.model.common.DefinedTermBase")
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);
64 protected static Map
<UUID
, SpecimenTypeDesignationStatus
> termMap
= null;
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");
88 // ************* CONSTRUCTORS *************/
90 * Class constructor: creates a new empty type designation status instance.
92 * @see #TypeDesignationStatus(String, String, String)
94 public SpecimenTypeDesignationStatus() {
99 * Class constructor: creates an additional type designation status instance
100 * with a description (in the {@link eu.etaxonomy.cdm.model.common.Language#DEFAULT() default language}), a label
101 * and a label abbreviation.
103 * @param term the string (in the default language) describing the
104 * new type designation status to be created
105 * @param label the string identifying the new type designation
106 * status to be created
107 * @param labelAbbrev the string identifying (in abbreviated form) the
108 * new type designation status to be created
109 * @see #TypeDesignationStatus()
111 public SpecimenTypeDesignationStatus(String term
, String label
, String labelAbbrev
) {
112 super(term
, label
, labelAbbrev
);
115 //************************** METHODS ********************************
118 * @see eu.etaxonomy.cdm.model.common.DefinedTermBase#resetTerms()
121 public void resetTerms(){
126 protected static SpecimenTypeDesignationStatus
findTermByUuid(UUID uuid
){
127 if (termMap
== null){
130 return (SpecimenTypeDesignationStatus
)termMap
.get(uuid
);
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.DerivedUnitBase 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 TaxonNameBase 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.
146 * @see eu.etaxonomy.cdm.model.common.DefinedTermBase#getKindOf()
149 public boolean isLectotype(){
150 if (this.equals(LECTOTYPE()) ||
151 this.equals(ISOLECTOTYPE()) ||
152 this.equals(SECOND_STEP_LECTOTYPE()) ||
153 this.equals(PARALECTOTYPE()) ){
161 * Returns the "unknown" designation status. One may choose this status to indicate that the type
165 public static final SpecimenTypeDesignationStatus
TYPE(){
166 return findTermByUuid(uuidType
);
170 * Returns the "holotype" designation status. A holotype of a
171 * set of names is the one {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase specimen or illustration}
172 * designated as the nomenclatural type by the {@link NonViralName#getCombinationAuthorTeam() author} of the
173 * "type-bringing" {@link TaxonNameBase taxon name} (or by the author of a later validated
174 * "invalid" taxon name).
176 * @see NameRelationshipType#VALIDATED_BY_NAME()
178 public static final SpecimenTypeDesignationStatus
HOLOTYPE(){
179 return findTermByUuid(uuidHolotype
);
183 * Returns the "lectotype" designation status. A lectotype is a
184 * {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase 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 TaxonNameBase 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.
192 public static final SpecimenTypeDesignationStatus
LECTOTYPE(){
193 return findTermByUuid(uuidLectotype
);
197 * Returns the "neotype" designation status. A neotype is a
198 * {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase specimen or illustration} selected to serve as nomenclatural type
199 * as long as all of the material on which the "type-bringing" {@link TaxonNameBase taxon name} was based
204 public static final SpecimenTypeDesignationStatus
NEOTYPE(){
205 return findTermByUuid(uuidNeotype
);
209 * Returns the "epitype" designation status. An epitype is a
210 * {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase 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 TaxonNameBase 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.
222 public static final SpecimenTypeDesignationStatus
EPITYPE(){
223 return findTermByUuid(uuidEpitype
);
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}.
232 public static final SpecimenTypeDesignationStatus
ISOTYPE(){
233 return findTermByUuid(uuidIsotype
);
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 TaxonNameBase#getNomenclaturalReference() protologue} of the
239 * "type-bringing" {@link TaxonNameBase taxon name} when no holotype was designated,
240 * or any one of two or more specimens simultaneously designated as types.
244 public static final SpecimenTypeDesignationStatus
SYNTYPE(){
245 return findTermByUuid(uuidSyntype
);
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 TaxonNameBase 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
257 public static final SpecimenTypeDesignationStatus
ISOSYNTYPE(){
258 return findTermByUuid(uuidIsosyntype
);
262 * Returns the "paratype" designation status. </BR>A paratype is a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen}
263 * cited in the {@link TaxonNameBase#getNomenclaturalReference() protologue} of the "type-bringing"
264 * {@link TaxonNameBase 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.
272 public static final SpecimenTypeDesignationStatus
PARATYPE(){
273 return findTermByUuid(uuidParatype
);
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}.
283 public static final SpecimenTypeDesignationStatus
ISOLECTOTYPE(){
284 return findTermByUuid(uuidIsolectotype
);
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}.
294 public static final SpecimenTypeDesignationStatus
ISONEOTYPE(){
295 return findTermByUuid(uuidIsoneotype
);
298 * Returns the "paraneotype" designation status. </BR>
299 * A paraneotype is a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen},
300 * cited when selecting a neotype, other than the neotype itself. Also
301 * called "neoparatype" in zoology.
305 public static final SpecimenTypeDesignationStatus
PARANEOTYPE(){
306 return findTermByUuid(uuidParaneotype
);
310 * Returns the "second step lectotype" designation status. </BR>
311 * A second step lectotype is a {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase specimen or illustration}, designated as lectotype
312 * in order to substitute another already existing lectotype.
316 public static final SpecimenTypeDesignationStatus
SECOND_STEP_LECTOTYPE(){
317 return findTermByUuid(uuidSecondStepLectotype
);
321 * Returns the "second step neotype" designation status. </BR>
322 * A second step neotype is a {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase specimen or illustration}, designated as neotype
323 * in order to substitute another already existing neotype.
327 public static final SpecimenTypeDesignationStatus
SECOND_STEP_NEOTYPE(){
328 return findTermByUuid(uuidSecondStepNeotype
);
332 * Returns the "paralectotype" designation status. </BR>
333 * A paralectotype is a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen}, cited when designating a lectotype, other than
334 * the lectotype itself. Also called "lectoparatype" in zoology.
338 public static final SpecimenTypeDesignationStatus
PARALECTOTYPE(){
339 return findTermByUuid(uuidParalectotype
);
343 * Returns the "isoepitype" designation status. An isoepitype is any
344 * duplicate of the epitype; it is always a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen}.
348 public static final SpecimenTypeDesignationStatus
ISOEPITYPE(){
349 return findTermByUuid(uuidIsoepitype
);
353 * Returns the "iconotype" designation status. An iconotype is a holotype or
354 * a lectotype that is a {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase drawing}
355 * and not a {@link eu.etaxonomy.cdm.model.occurrence.Specimen specimen}.
356 * "Iconotype" does not have type status according to the ICBN.
361 public static final SpecimenTypeDesignationStatus
ICONOTYPE(){
362 return findTermByUuid(uuidIconotype
);
366 * Returns the "unspecific" type designation status. Used if from literature where it is not
367 * clear if it refers to another publication not cited or if it is a new designation.
370 public static final SpecimenTypeDesignationStatus
UNSPECIFIC(){
371 return findTermByUuid(uuidUnspecified
);
375 * Returns the "original material" type designation status.
376 * Botanical term for material from which a lectotype can be designated.
377 * "Original material" does not have type status according to the ICBN.
380 public static final SpecimenTypeDesignationStatus
ORIGINAL_MATERIAL(){
381 return findTermByUuid(uuidOriginalMaterial
);
386 * Returns the "phototype" type designation status.
387 * "Phototype" does not have type status according to the ICBN.
390 public static final SpecimenTypeDesignationStatus
PHOTOTYPE(){
391 return findTermByUuid(uuidPhototype
);
395 protected void setDefaultTerms(TermVocabulary
<SpecimenTypeDesignationStatus
> termVocabulary
) {
396 termMap
= new HashMap
<UUID
, SpecimenTypeDesignationStatus
>();
397 for (SpecimenTypeDesignationStatus term
: termVocabulary
.getTerms()){
398 termMap
.put(term
.getUuid(), term
);