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
;
14 import eu
.etaxonomy
.cdm
.model
.common
.OrderedTermBase
;
15 import eu
.etaxonomy
.cdm
.strategy
.exceptions
.UnknownCdmTypeException
;
17 import org
.apache
.log4j
.Logger
;
20 import javax
.persistence
.*;
23 * http://rs.tdwg.org/ontology/voc/TaxonName.rdf#PublicationStatus
26 * @created 08-Nov-2007 13:06:39
29 public class NomenclaturalStatusType
extends OrderedTermBase
<NomenclaturalStatusType
> {
30 static Logger logger
= Logger
.getLogger(NomenclaturalStatusType
.class);
32 private static final UUID uuidAmbiguous
= UUID
.fromString("90f5012b-705b-4488-b4c6-002d2bc5198e");
33 private static final UUID uuidDoubtful
= UUID
.fromString("0ffeb39e-872e-4c0f-85ba-a4150d9f9e7d");
34 private static final UUID uuidConfusum
= UUID
.fromString("24955174-aa5c-4e71-a2fd-3efc79e885db");
35 private static final UUID uuidIllegitimate
= UUID
.fromString("b7c544cf-a375-4145-9d3e-4b97f3f18108");
36 private static final UUID uuidSuperfluous
= UUID
.fromString("6890483a-c6ba-4ae1-9ab1-9fbaa5736ce9");
37 private static final UUID uuidRejected
= UUID
.fromString("48107cc8-7a5b-482e-b438-efbba050b851");
38 private static final UUID uuidUtiqueRejected
= UUID
.fromString("04338fdd-c12a-402f-a1ca-68b4bf0be042");
39 private static final UUID uuidConservedProp
= UUID
.fromString("82bab006-5aed-4301-93ec-980deb30cbb1");
40 private static final UUID uuidOrthographyConservedProp
= UUID
.fromString("02f82bc5-1066-454b-a023-11967cba9092");
41 private static final UUID uuidLegitimate
= UUID
.fromString("51a3613c-b53b-4561-b0cd-9163d91c15aa");
42 private static final UUID uuidAlternative
= UUID
.fromString("3b8a8519-420f-4dfa-b050-b410cc257961");
43 private static final UUID uuidNovum
= UUID
.fromString("05fcb68f-af60-4851-b912-892512058897");
44 private static final UUID uuidUtiqueRejectedProp
= UUID
.fromString("643ee07f-026c-426c-b838-c778c8613383");
45 private static final UUID uuidOrthographyConserved
= UUID
.fromString("34a7d383-988b-4117-b8c0-52b947f8c711");
46 private static final UUID uuidRejectedProp
= UUID
.fromString("248e44c2-5436-4526-a352-f7467ecebd56");
47 private static final UUID uuidConserved
= UUID
.fromString("6330f719-e2bc-485f-892b-9f882058a966");
48 private static final UUID uuidSanctioned
= UUID
.fromString("1afe55c4-76aa-46c0-afce-4dc07f512733");
49 private static final UUID uuidInvalid
= UUID
.fromString("b09d4f51-8a77-442a-bbce-e7832aaf46b7");
50 private static final UUID uuidNudum
= UUID
.fromString("e0d733a8-7777-4b27-99a3-05ab50e9f312");
51 private static final UUID uuidCombinationInvalid
= UUID
.fromString("f858e619-7b7f-4225-913b-880a2143ec83");
52 private static final UUID uuidProvisional
= UUID
.fromString("a277507e-ad93-4978-9419-077eb889c951");
56 public NomenclaturalStatusType() {
58 // TODO Auto-generated constructor stub
61 public NomenclaturalStatusType(String term
, String label
) {
63 // TODO Auto-generated constructor stub
66 public static final NomenclaturalStatusType
getByUuid(UUID uuid
){
67 return (NomenclaturalStatusType
) findByUuid(uuid
);
72 public boolean isInvalidType(){
73 if (this.equals(INVALID()) ||
74 this.equals(NUDUM()) ||
75 this.equals(PROVISIONAL()) ||
76 this.equals(COMBINATION_INVALID())
85 public boolean isLegitimateType(){
86 if (this.equals(LEGITIMATE()) ||
87 this.equals(NOVUM()) ||
88 this.equals(ALTERNATIVE()) ||
89 this.equals(CONSERVED()) ||
90 this.equals(ORTHOGRAPHY_CONSERVED()) ||
91 this.equals(REJECTED_PROP()) ||
92 this.equals(UTIQUE_REJECTED_PROP())
101 public boolean isIllegitimateType(){
102 if (this.equals(ILLEGITIMATE()) ||
103 this.equals(SUPERFLUOUS()) ||
104 this.equals(REJECTED()) ||
105 this.equals(UTIQUE_REJECTED()) ||
106 this.equals(CONSERVED_PROP()) ||
107 this.equals(ORTHOGRAPHY_CONSERVED_PROP())
115 public static final NomenclaturalStatusType
AMBIGUOUS(){
116 return getByUuid(uuidAmbiguous
);
119 public static final NomenclaturalStatusType
DOUBTFUL(){
120 return getByUuid(uuidDoubtful
);
123 public static final NomenclaturalStatusType
CONFUSUM(){
124 return getByUuid(uuidConfusum
);
127 public static final NomenclaturalStatusType
ILLEGITIMATE(){
128 return getByUuid(uuidIllegitimate
);
131 public static final NomenclaturalStatusType
SUPERFLUOUS(){
132 return getByUuid(uuidSuperfluous
);
135 public static final NomenclaturalStatusType
REJECTED(){
136 return getByUuid(uuidRejected
);
139 public static final NomenclaturalStatusType
UTIQUE_REJECTED(){
140 return getByUuid(uuidUtiqueRejected
);
143 public static final NomenclaturalStatusType
CONSERVED_PROP(){
144 return getByUuid(uuidConservedProp
);
147 public static final NomenclaturalStatusType
ORTHOGRAPHY_CONSERVED_PROP(){
148 return getByUuid(uuidOrthographyConservedProp
);
151 public static final NomenclaturalStatusType
LEGITIMATE(){
152 return getByUuid(uuidLegitimate
);
155 public static final NomenclaturalStatusType
ALTERNATIVE(){
156 return getByUuid(uuidAlternative
);
159 public static final NomenclaturalStatusType
NOVUM(){
160 return getByUuid(uuidNovum
);
163 public static final NomenclaturalStatusType
UTIQUE_REJECTED_PROP(){
164 return getByUuid(uuidUtiqueRejectedProp
);
167 public static final NomenclaturalStatusType
ORTHOGRAPHY_CONSERVED(){
168 return getByUuid(uuidOrthographyConserved
);
171 public static final NomenclaturalStatusType
REJECTED_PROP(){
172 return getByUuid(uuidRejectedProp
);
175 public static final NomenclaturalStatusType
CONSERVED(){
176 return getByUuid(uuidConserved
);
179 public static final NomenclaturalStatusType
SANCTIONED(){
180 return getByUuid(uuidSanctioned
);
183 public static final NomenclaturalStatusType
INVALID(){
184 return getByUuid(uuidInvalid
);
187 public static final NomenclaturalStatusType
NUDUM(){
188 return getByUuid(uuidNudum
);
191 public static final NomenclaturalStatusType
COMBINATION_INVALID(){
192 return getByUuid(uuidCombinationInvalid
);
195 public static final NomenclaturalStatusType
PROVISIONAL(){
196 return getByUuid(uuidProvisional
);
201 // nom. subnud.: nomen subnudum
202 // orth. var.: orthographic variant
203 // opus utique oppr.: operautique oppressa
204 // pro syn.: pro synonymo
207 * preliminary implementation for BotanicalNameParser
211 public static NomenclaturalStatusType
getNomenclaturalStatusTypeByAbbreviation(String statusAbbreviation
) throws UnknownCdmTypeException
{
212 if (statusAbbreviation
== null){ throw new NullPointerException("statusAbbreviation is 'null' in getNomenclaturalStatusTypeByAbbreviation");
213 }else if (statusAbbreviation
.equalsIgnoreCase("nom. superfl.")){ return NomenclaturalStatusType
.SUPERFLUOUS();
214 }else if (statusAbbreviation
.equalsIgnoreCase("nom. nud.")){ return NomenclaturalStatusType
.NUDUM();
215 }else if (statusAbbreviation
.equalsIgnoreCase("nom. illeg.")){return NomenclaturalStatusType
.ILLEGITIMATE();
216 }else if (statusAbbreviation
.equalsIgnoreCase("nom. inval.")) { return NomenclaturalStatusType
.INVALID();
217 }else if (statusAbbreviation
.equalsIgnoreCase("nom. cons.")) { return NomenclaturalStatusType
.CONSERVED();
218 }else if (statusAbbreviation
.equalsIgnoreCase("nom. alternativ.")) { return NomenclaturalStatusType
.ALTERNATIVE();
220 //}else if (statusAbbreviation.equalsIgnoreCase("nom. subnud.")) { return NomenclaturalStatusType.su;
221 }else if (statusAbbreviation
.equalsIgnoreCase("nom. rej.")) { return NomenclaturalStatusType
.REJECTED();
222 }else if (statusAbbreviation
.equalsIgnoreCase("nom. rej. prop.")) { return NomenclaturalStatusType
.REJECTED_PROP();
223 }else if (statusAbbreviation
.equalsIgnoreCase("nom. provis.")) { return NomenclaturalStatusType
.PROVISIONAL();
226 if (statusAbbreviation
== null){
227 statusAbbreviation
= "(null)";
229 throw new eu
.etaxonomy
.cdm
.strategy
.exceptions
.UnknownCdmTypeException("Unknown NomenclaturalStatusType abbreviation: " + statusAbbreviation
);