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
;
25 import org
.hibernate
.search
.annotations
.Indexed
;
27 import eu
.etaxonomy
.cdm
.model
.common
.TermType
;
28 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
31 * The terms in this class define the status of a {@link NameTypeDesignation name type designation}.
33 * @author a.babadshanjan
37 @XmlAccessorType(XmlAccessType
.FIELD
)
38 @XmlType(name
= "NameTypeDesignationStatus")
40 @Indexed(index
= "eu.etaxonomy.cdm.model.common.DefinedTermBase")
42 public class NameTypeDesignationStatus
extends TypeDesignationStatusBase
<NameTypeDesignationStatus
> {
43 private static final long serialVersionUID
= -8801837496688711907L;
44 @SuppressWarnings("unused")
45 private static final Logger logger
= Logger
.getLogger(NameTypeDesignationStatus
.class);
47 private static final UUID uuidAutomatic
= UUID
.fromString("e89d8b21-615a-4602-913f-1625bf39a69f");
48 private static final UUID uuidMonotypy
= UUID
.fromString("3fc639b2-9a64-45f8-9a81-657a4043ad74");
49 private static final UUID uuidNotApplicable
= UUID
.fromString("91a9d6a9-7754-41cd-9f7e-be136f599f7e");
50 private static final UUID uuidOriginalDesignation
= UUID
.fromString("40032a44-973b-4a64-b25e-76f86c3a753c");
51 private static final UUID uuidPresentDesignation
= UUID
.fromString("e5f38f5d-995d-4470-a036-1a9792a543fc");
52 private static final UUID uuidSubsequentMonotypy
= UUID
.fromString("2b5806d8-31b0-406e-a32a-4adac0c89ae4");
53 private static final UUID uuidSubsequentDesignation
= UUID
.fromString("3e449e7d-a03c-4431-a7d3-aa258406f6b2");
54 private static final UUID uuidTautonymy
= UUID
.fromString("84521f09-3e10-43f5-aa6f-2173a55a6790");
55 private static final UUID uuidLectotype
= UUID
.fromString("4177c938-b741-40e1-95e5-4c53bd1ed87d");
58 * Factory method: creates an additional type designation status instance
59 * with a description (in the {@link eu.etaxonomy.cdm.model.common.Language#DEFAULT() default language}), a label
60 * and a label abbreviation.
62 * @param term the string (in the default language) describing the
63 * new name type designation status to be created
64 * @param label the string identifying the new name type designation
65 * status to be created
66 * @param labelAbbrev the string identifying (in abbreviated form) the
67 * new name type designation status to be created
69 public static NameTypeDesignationStatus
NewInstance(String term
, String label
, String labelAbbrev
){
70 return new NameTypeDesignationStatus(term
, label
, labelAbbrev
);
73 protected static Map
<UUID
, NameTypeDesignationStatus
> termMap
= null;
75 protected static NameTypeDesignationStatus
findTermByUuid(UUID uuid
){
79 return (NameTypeDesignationStatus
)termMap
.get(uuid
);
82 // ************* CONSTRUCTORS *************/
85 * Class constructor: creates a new empty name type designation status instance.
87 * @see #NameTypeDesignationStatus(String, String, String)
89 @Deprecated //public use by term initializer only TODO needs to be changed
90 public NameTypeDesignationStatus() {
93 protected NameTypeDesignationStatus(String term
, String label
, String labelAbbrev
) {
94 super(TermType
.NameTypeDesignationStatus
, term
, label
, labelAbbrev
);
97 //************************** METHODS ********************************
100 * @see eu.etaxonomy.cdm.model.common.DefinedTermBase#resetTerms()
103 public void resetTerms(){
109 * Returns the "automatic" name type designation status.</BR>
110 * If a new name has to be established for a genus name this new name automatically gets
111 * the same type species as the old name.
114 public static final NameTypeDesignationStatus
AUTOMATIC(){
115 return findTermByUuid(uuidAutomatic
);
119 * Returns the "monotypy" name type designation status.</BR>
120 * Only one species was included in original genus description.
122 * No {@linkplain TypeDesignationBase#getCitation() citation} is needed
123 * for a monotypy as the type species is decided within the original paper.
125 public static final NameTypeDesignationStatus
MONOTYPY(){
126 return findTermByUuid(uuidMonotypy
);
130 * Returns the "not applicable" name type designation status.</BR>
131 * Used in the BDWD (BioSystematic Database of World Diptera) for
132 * nomina nuda, emendations and misspellings.
134 public static final NameTypeDesignationStatus
NOT_APPLICABLE(){
135 return findTermByUuid(uuidNotApplicable
);
139 * Returns the "original designation" name type designation status.</BR>
140 * The type species is designated in the original genus description
141 * (this includes indication in the species name typicus).
143 * No {@linkplain TypeDesignationBase#getCitation() citation} is needed
144 * for an original designation as the type species is decided within the original paper.
146 public static final NameTypeDesignationStatus
ORIGINAL_DESIGNATION(){
147 return findTermByUuid(uuidOriginalDesignation
);
151 * Returns the "present designation" name type designation status.</BR>
152 * The type species is designated now (maybe possible in future,
153 * after ICZN has changed and online publications are available).
155 public static final NameTypeDesignationStatus
PRESENT_DESIGNATION(){
156 return findTermByUuid(uuidPresentDesignation
);
160 * Returns the "subsequent monotypy" name type designation status.</BR>
161 * If only one nominal species was first subsequently included
162 * in a nominal genus or subgenus established without included species,
163 * that nominal species is automatically fixed as the type species,
164 * by subsequent monotypy.
167 public static final NameTypeDesignationStatus
SUBSEQUENT_MONOTYPY(){
168 return findTermByUuid(uuidSubsequentMonotypy
);
172 * Returns the "subsequent designation" name type designation status.</BR>
173 * Several species were included in the original genus description.
174 * One of these has been designated as type species in a later publication.
178 public static final NameTypeDesignationStatus
SUBSEQUENT_DESIGNATION(){
179 return findTermByUuid(uuidSubsequentDesignation
);
184 * Returns the lectotype name type designation status.</BR>
185 * This may be the same as a {@link SUBSEQUENT_DESIGNATION()} but used in botany.
186 * Maybe these 2 status will be merged in future.
188 public static final NameTypeDesignationStatus
LECTOTYPE(){
189 return findTermByUuid(uuidLectotype
);
193 * Returns the "tautonomy" name type designation status.</BR>
194 * The genus name is the same as the species name of one of the included species.
197 public static final NameTypeDesignationStatus
TAUTONYMY(){
198 return findTermByUuid(uuidTautonymy
);
203 protected void setDefaultTerms(TermVocabulary
<NameTypeDesignationStatus
> termVocabulary
) {
204 termMap
= new HashMap
<UUID
, NameTypeDesignationStatus
>();
205 for (NameTypeDesignationStatus term
: termVocabulary
.getTerms()){
206 termMap
.put(term
.getUuid(), term
);
211 * Returns the boolean value indicating whether <i>this</i> type designation
212 * status is itself "lectotype" or a kind of "lectotype" (true) or not
213 * (false). Returns false if <i>this</i> type designation status is null.<BR>
214 * A lectotype is a {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase specimen or illustration} designated as the
215 * nomenclatural type, when no holotype was indicated at the time of
216 * publication of the "type-bringing" {@link TaxonNameBase taxon name}, when the
217 * holotype is found to be assigned to taxon names belonging to more than
218 * one {@link HomotypicalGroup homotypical group}, or as long as it is missing.
222 * @see eu.etaxonomy.cdm.model.common.DefinedTermBase#getKindOf()
225 public boolean isLectotype(){
227 this.equals(LECTOTYPE()) ||
228 this.equals(SUBSEQUENT_DESIGNATION()) ||
229 this.equals(PRESENT_DESIGNATION() )