3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.cdm
.model
.name
;
13 import java
.util
.HashMap
;
15 import java
.util
.UUID
;
17 import javax
.persistence
.Entity
;
18 import javax
.persistence
.Transient
;
19 import javax
.xml
.bind
.annotation
.XmlAccessType
;
20 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
21 import javax
.xml
.bind
.annotation
.XmlType
;
23 import org
.apache
.log4j
.Logger
;
24 import org
.hibernate
.envers
.Audited
;
26 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
27 import eu
.etaxonomy
.cdm
.model
.common
.OrderedTermBase
;
28 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
32 * @author a.babadshanjan
36 @XmlAccessorType(XmlAccessType
.FIELD
)
37 @XmlType(name
= "NameTypeDesignationStatus")
40 public class NameTypeDesignationStatus
extends TypeDesignationStatusBase
<NameTypeDesignationStatus
> {
41 static Logger logger
= Logger
.getLogger(NameTypeDesignationStatus
.class);
43 private static final UUID uuidAutomatic
= UUID
.fromString("e89d8b21-615a-4602-913f-1625bf39a69f");
44 private static final UUID uuidFirstRevisor
= UUID
.fromString("a14ec046-c48f-4a73-939f-bd57880c7565");
45 private static final UUID uuidMonotypy
= UUID
.fromString("3fc639b2-9a64-45f8-9a81-657a4043ad74");
46 private static final UUID uuidNotApplicable
= UUID
.fromString("91a9d6a9-7754-41cd-9f7e-be136f599f7e");
47 private static final UUID uuidOriginalDesignation
= UUID
.fromString("40032a44-973b-4a64-b25e-76f86c3a753c");
48 private static final UUID uuidPresentDesignation
= UUID
.fromString("e5f38f5d-995d-4470-a036-1a9792a543fc");
49 private static final UUID uuidSubsequentMonotypy
= UUID
.fromString("2b5806d8-31b0-406e-a32a-4adac0c89ae4");
50 private static final UUID uuidSubsequentDesignation
= UUID
.fromString("3e449e7d-a03c-4431-a7d3-aa258406f6b2");
51 private static final UUID uuidTautonymy
= UUID
.fromString("84521f09-3e10-43f5-aa6f-2173a55a6790");
53 protected static Map
<UUID
, NameTypeDesignationStatus
> termMap
= null;
55 protected static NameTypeDesignationStatus
findTermByUuid(UUID uuid
){
59 return (NameTypeDesignationStatus
)termMap
.get(uuid
);
62 // ************* CONSTRUCTORS *************/
65 * Class constructor: creates a new empty name type designation status instance.
67 * @see #NameTypeDesignationStatus(String, String, String)
69 public NameTypeDesignationStatus() {
73 * Class constructor: creates an additional type designation status instance
74 * with a description (in the {@link eu.etaxonomy.cdm.model.common.Language#DEFAULT() default language}), a label
75 * and a label abbreviation.
77 * @param term the string (in the default language) describing the
78 * new name type designation status to be created
79 * @param label the string identifying the new name type designation
80 * status to be created
81 * @param labelAbbrev the string identifying (in abbreviated form) the
82 * new name type designation status to be created
84 public NameTypeDesignationStatus(String term
, String label
, String labelAbbrev
) {
85 super(term
, label
, labelAbbrev
);
88 //********* METHODS **************************************
92 * Returns the "automatic" name type designation status.
93 * If a new name has to be established for a genus name this new name automatically gets
94 * the same type species as the old name.
96 public static final NameTypeDesignationStatus
AUTOMATIC(){
97 return findTermByUuid(uuidAutomatic
);
101 * Returns the "first revisor" name type designation status.
102 * Used in the BDWD for incorrect original spellings only. This is only a way of dealing
103 * with misspellings in the database, not an actual type designation.
105 public static final NameTypeDesignationStatus
FIRST_REVISOR(){
106 return findTermByUuid(uuidFirstRevisor
);
110 * Returns the "monotypy" name type designation status.
111 * Only one species was included in original genus description.
113 public static final NameTypeDesignationStatus
MONOTYPY(){
114 return findTermByUuid(uuidMonotypy
);
118 * Returns the "not applicable" name type designation status.
119 * Used in the BDWD for nomina nuda, emendations and misspellings.
121 public static final NameTypeDesignationStatus
NOT_APPLICABLE(){
122 return findTermByUuid(uuidNotApplicable
);
126 * Returns the "original designation" name type designation status.
127 * The type species is designated in the original genus description
128 * (this includes indication in the species name typicus).
130 public static final NameTypeDesignationStatus
ORIGINAL_DESIGNATION(){
131 return findTermByUuid(uuidOriginalDesignation
);
135 * Returns the "present designation" name type designation status.
136 * The type species is designated now (maybe possible in future,
137 * after ICZN has changed).
139 public static final NameTypeDesignationStatus
PRESENT_DESIGNATION(){
140 return findTermByUuid(uuidPresentDesignation
);
144 * Returns the "subsequent monotypy" name type designation status.
145 * If only one nominal species was first subsequently included
146 * in a nominal genus or subgenus established without included species,
147 * that nominal species is automatically fixed as the type species,
148 * by subsequent monotypy.
150 public static final NameTypeDesignationStatus
SUBSEQUENT_MONOTYPY(){
151 return findTermByUuid(uuidSubsequentMonotypy
);
155 * Returns the "subsequent designation" name type designation status.
156 * Several species were included in the original genus description.
157 * One of these has been designated as type species in a later publication.
159 public static final NameTypeDesignationStatus
SUBSEQUENT_DESIGNATION(){
160 return findTermByUuid(uuidSubsequentDesignation
);
164 * Returns the "tautonomy" name type designation status.
165 * The genus name is the same as the species name of one of the included species.
167 public static final NameTypeDesignationStatus
TAUTONYMY(){
168 return findTermByUuid(uuidTautonymy
);
172 protected void setDefaultTerms(TermVocabulary
<NameTypeDesignationStatus
> termVocabulary
) {
173 termMap
= new HashMap
<UUID
, NameTypeDesignationStatus
>();
174 for (NameTypeDesignationStatus term
: termVocabulary
.getTerms()){
175 termMap
.put(term
.getUuid(), term
);